public static void Configure(CommandLineApplication command, GlobalOptions options) { command.Description = "Removes connection from configuration file"; command.HelpOption("-?|-h|--help"); command.Options.Add(options.LocalConfigFilePathOption); var connectionIdArg = command.Argument("<сonnection ID>", "The ID of the connection stored in the configuration") .IsRequired(); Func <int> runCommandFunc = new ConnectionsRemoveCommand(connectionIdArg, options).Run; command.OnExecute(runCommandFunc); }
public static void Configure(CommandLineApplication command, GlobalOptions options) { command.Description = "Manipulates with connections (add, remove, list)"; command.HelpOption("-?|-h|--help"); // add local config option command.Options.Add(options.LocalConfigFilePathOption); // add connections subcommands command.Command("add", c => ConnectionsAddCommand.Configure(c, options)); command.Command("remove", c => ConnectionsRemoveCommand.Configure(c, options)); command.Command("list", c => ConnectionsListCommand.Configure(c, options)); command.OnExecute(new ConnectionsCommand(command).Run); }