Adding some documentation to crosslang shell

This commit is contained in:
2025-03-28 22:06:34 -05:00
parent 8811a8c9c4
commit 6c5772c6c8
25 changed files with 1167 additions and 271 deletions

View File

@@ -11,6 +11,7 @@
"template_info": {
"type": "compile_tool"
},
"template_ignored_files": ["bin","obj"]
"template_ignored_files": ["bin","obj"],
"description": "A tool that can be a dependency to a project (including libraries) that runs at compile time"
}
}

View File

@@ -11,6 +11,7 @@
"template_info": {
"type": "console"
},
"template_ignored_files": ["bin","obj"]
"template_ignored_files": ["bin","obj"],
"description": "A console application"
}
}

View File

@@ -11,6 +11,7 @@
"template_info": {
"type": "lib"
},
"template_ignored_files": ["bin","obj"]
"template_ignored_files": ["bin","obj"],
"description": "A crosslang library"
}
}

View File

@@ -8,6 +8,7 @@
"homepage": "https://crosslang.tesseslanguage.com/",
"license": "MIT",
"template_name": "template",
"description": "A template for a project",
"template_info": {
"type": "template",
"template_name": "mytemplate",

View File

@@ -0,0 +1,2 @@
bin
obj

25
Templates/tool/cross.json Normal file
View File

@@ -0,0 +1,25 @@
{
"dependencies": [],
"info": {
"template_ignored_files": [
"bin",
"obj"
],
"template_info": {
"type": "tool",
"description": "This is my tool",
"toolname": "changeme"
},
"template_extra_text_ftles": [],
"template_project_dependencies": [],
"template_name": "tool",
"description": "A crosslang tool that you can run via crosslang tool",
"type": "template",
"maintainer": "Mike Nolan",
"repo": "https://onedev.site.tesses.net/CrossLang/CrossLangExtras",
"homepage": "https://crosslang.tesseslanguage.com/",
"license": "MIT"
},
"version": "1.0.0.0-prod",
"name": "Tesses.CrossLang.Template.Tool"
}

View File

@@ -0,0 +1,30 @@
/*
you must change the toolname in cross.json -> info -> toolname
to run the tool from the project folder use crosslang tool-test [flags-options-and-arguments]
to install the tool use crosslang install-tool from working directory
to run the tool after being installed use crosslang tool <toolname> [flags-and-options-and-arguments]
you can push the tool to cpkg
*/
func RunTool(arg)
{
//Flags are strings without the -- just like from Tesses.CrossLang.Args, so --Johnny would yield a string with the value Johnny
//Options are a dictionary with a field named Key which is the name without the -- just like from Tesses.CrossLang.Args where the Value is from after the = sign just like Tesses.CrossLang.Args, so --John=Joel would yield a dictionary like this {Key="John", Value="Joel"}
//Arguments is a list of strings when an argument does not start with -- or is after the -- (it starts after the tool name)
//ToolName is the tool name
Console.WriteLine($"TOOLNAME: {arg.ToolName}");
Console.WriteLine("FLAGS:");
each(var flag : arg.Flags)
{
Console.WriteLine(flag);
}
Console.WriteLine("OPTIONS:");
each(var option : arg.Options)
{
Console.WriteLine($"{option.Key}: {option.Value}");
}
Console.WriteLine("ARGUMENTS:");
each(var argument : arg.Arguments)
{
Console.WriteLine(argument);
}
}