예제 #1
0
        public static void Configure(CommandLineApplication command, GlobalOptions options)
        {
            command.Description = "Adds connection to configuration file";
            command.HelpOption("-?|-h|--help");

            command.Options.Add(options.LocalConfigFilePathOption);

            var argumets = new Arguments(command);

            Func <int> runCommandFunc = new ConnectionsAddCommand(argumets, options).Run;

            command.OnExecute(runCommandFunc);
        }
예제 #2
0
        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);
        }