refactoring + [WIP/ci]
This commit is contained in:
parent
aec12b3177
commit
19a63b5610
12 changed files with 167 additions and 71 deletions
38
cli/Program.cs
Normal file
38
cli/Program.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
using System;
|
||||
using Microsoft.Extensions.CommandLineUtils;
|
||||
|
||||
namespace cli
|
||||
{
|
||||
public partial class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CommandOption rootCommandHelpOption = null;
|
||||
|
||||
CommandLineApplication cliapp = new CommandLineApplication(false);
|
||||
cliapp.Name = "cli";
|
||||
cliapp.FullName = "Yavsc command line interface";
|
||||
cliapp.Description = "Dnx console for yavsc server side";
|
||||
cliapp.ShortVersionGetter = () => "v1.0";
|
||||
cliapp.LongVersionGetter = () => "version 1.0 (stable)";
|
||||
rootCommandHelpOption = cliapp.HelpOption("-? | -h | --help");
|
||||
|
||||
var sb = SendMailCommandProvider.Handle(cliapp);
|
||||
if (args.Length == 0)
|
||||
{
|
||||
cliapp.ShowHint();
|
||||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
cliapp.Execute(args);
|
||||
|
||||
if (cliapp.RemainingArguments.Count > 0)
|
||||
{
|
||||
cliapp.ShowHint();
|
||||
Environment.Exit(2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue