static void Main(string[] args) { // Override the arguments to allow debug/breakpoints with arguments //args = new string[3]; //args[0] = "watch"; //args[1] = "-d"; //args[2] = @"C:\Users\Lucas\source\repos\zdragon.net\releaseTemp\"; var app = new CommandLineApplication(); app.Name = "ckc"; app.HelpOption("-?|-h|--help"); app.VersionOption("-v|--version", "v2.0.5-beta"); //TODO dynamic solution app.OnExecute(() => { return(0); }); CommandsBuilder.CreateBuildCommand(app); CommandsBuilder.CreateWatchCommand(app); CommandsBuilder.CreateServeCommand(app); try { app.Execute(args); } catch (CommandParsingException commandParsingException) { app.Error.WriteLine("Error: " + commandParsingException.Message); app.ShowHelp(); } }
static void Main(string[] args) { var app = new CommandLineApplication(); app.Name = "ZDragon.NET"; app.HelpOption("-?|-h|--help"); app.OnExecute(() => { return(0); }); CommandsBuilder.CreateBuildCommand(app); CommandsBuilder.CreateWatchCommand(app); CommandsBuilder.CreateServeCommand(app); app.Execute(args); }
static void Main(string[] args) { if (args.Length == 0) { args = new [] { "watch", "-s" }; } SignalSingleton.ExitSignal.Subscribe(() => { Environment.Exit(0); }); var app = new CommandLineApplication(); app.Name = "ckc"; app.HelpOption("-?|-h|--help"); app.VersionOption("-v|--version", "v2.1.15-beta"); app.OnExecute(() => 0); Console.WriteLine("Welcome to ZDragon!"); if (!args.Contains("-v")) { app.ShowVersion(); } CommandsBuilder.CreateBuildCommand(app); CommandsBuilder.CreateWatchCommand(app); CommandsBuilder.CreateServeCommand(app); try { app.Execute(args); } catch (CommandParsingException commandParsingException) { app.Error.WriteLine("Error: " + commandParsingException.Message); app.ShowHelp(); } }