yavsc/cli/Program.cs

44 lines
1.2 KiB
C#
Raw Normal View History

2018-07-28 01:55:13 +02:00

using System;
2018-08-05 04:16:21 +02:00
using cli.Commands;
2018-07-28 01:55:13 +02:00
using Microsoft.Extensions.CommandLineUtils;
namespace cli
{
public partial class Program
{
2018-07-30 11:21:57 +02:00
2018-07-28 01:55:13 +02:00
public static void Main(string[] args)
{
CommandOption rootCommandHelpOption = null;
CommandLineApplication cliapp = new CommandLineApplication(false);
cliapp.Name = "cli";
cliapp.FullName = "Yavsc command line interface";
2018-07-30 11:21:57 +02:00
cliapp.Description = "Dnx console app for yavsc server side";
2018-07-28 01:55:13 +02:00
cliapp.ShortVersionGetter = () => "v1.0";
cliapp.LongVersionGetter = () => "version 1.0 (stable)";
rootCommandHelpOption = cliapp.HelpOption("-? | -h | --help");
2018-08-05 04:16:21 +02:00
(new SendMailCommandProvider()).Integrate(cliapp);
(new GenerateJsonSchema()).Integrate(cliapp);
(new AuthCommander()).Integrate(cliapp);
(new CiBuildCommand()).Integrate(cliapp);
2018-07-28 01:55:13 +02:00
if (args.Length == 0)
{
cliapp.ShowHint();
Environment.Exit(1);
}
cliapp.Execute(args);
if (cliapp.RemainingArguments.Count > 0)
{
cliapp.ShowHint();
Environment.Exit(2);
}
}
}
}