public static void Configure(CommandLineApplication app) { app.Name = "aistdoc"; app.HelpOption("-?|-h|--help"); // Register commands app.Command("publish", c => PublsihDocCommand.Configure(c)); app.Command("create", c => CreateConfigCommand.Configure(c)); app.Command("changelog", c => ChangelogCommand.Configure(c)); Func <int> runCommandFunc = new RootCommand(app).Run; app.OnExecute(runCommandFunc); }
public static void Configure(CommandLineApplication command) { command.Description = "Creates configuration file"; command.HelpOption("-?|-h|--help"); var fileNameOp = command.Option("--file:<filename> | -f:<filename>", "New config file name", optionType: CommandOptionType.SingleOrNoValue); var modeOp = command.Option("--mode:<mode> | -m: <mode>", "The mode. cs, ts or git", optionType: CommandOptionType.SingleOrNoValue) .Accepts(b => b .Values("cs", "ts", "git") ); Func <int> runCommandFunc = new CreateConfigCommand(fileNameOp, modeOp).Run; command.OnExecute(runCommandFunc); }