Skip to content
Snippets Groups Projects
Commit de9a1f70 authored by John Cheesman's avatar John Cheesman
Browse files

Add command line utils

parent 30fc6319
No related branches found
No related tags found
1 merge request!1Add CLI
using System;
using System.Text;
using TiledToOrx.Core;
using Microsoft.Extensions.CommandLineUtils;
namespace TiledToOrx.CLI
{
......@@ -8,7 +9,25 @@ namespace TiledToOrx.CLI
{
static void Main(string[] args)
{
var fileName = args[0];
var app = new CommandLineApplication();
app.Name = "TiledToOrx";
app.Description = "Convert TMX files to Orx config data";
app.HelpOption("-?|-h|--help");
var fileName = app.Option(
"-f|--fileName<optionvalue>",
"",
CommandOptionType.SingleValue);
app.OnExecute(() => {
Console.WriteLine(fileName);
return 0;
});
app.Execute(args);
/* var fileName = args[0];
StringBuilder sb = new StringBuilder();
......@@ -16,7 +35,7 @@ namespace TiledToOrx.CLI
engine.Convert(fileName, sb, false, 0);
Console.WriteLine(sb.ToString());
Console.WriteLine(sb.ToString()); */
}
}
}
......@@ -4,6 +4,10 @@
<ProjectReference Include="..\TiledToOrx.Core\TiledToOrx.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
</ItemGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment