mirror of
https://onedev.site.tesses.net/crosslang/crosslangextras
synced 2026-02-08 17:15:45 +00:00
Adding some documentation to crosslang shell
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
"template_info": {
|
||||
"type": "console"
|
||||
},
|
||||
"template_ignored_files": ["bin","obj"]
|
||||
"template_ignored_files": ["bin","obj"],
|
||||
"description": "A console application"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
"template_info": {
|
||||
"type": "lib"
|
||||
},
|
||||
"template_ignored_files": ["bin","obj"]
|
||||
"template_ignored_files": ["bin","obj"],
|
||||
"description": "A crosslang library"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
2
Templates/tool/.crossarchiveignore
Normal file
2
Templates/tool/.crossarchiveignore
Normal file
@@ -0,0 +1,2 @@
|
||||
bin
|
||||
obj
|
||||
25
Templates/tool/cross.json
Normal file
25
Templates/tool/cross.json
Normal 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"
|
||||
}
|
||||
30
Templates/tool/src/main.tcross
Normal file
30
Templates/tool/src/main.tcross
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user