コード例 #1
0
        public CommandLineApplication()
        {
            Application = new McMaster.Extensions.CommandLineUtils.CommandLineApplication(throwOnUnexpectedArg: false);
            Application.HelpOption("-? | -h | --help");

            _applicationRoot  = Application.Option("-s | --source", "Solution or directory for OmniSharp to point at (defaults to current directory).", CommandOptionType.SingleValue);
            _logLevel         = Application.Option("-l | --loglevel", "Level of logging (defaults to 'Information').", CommandOptionType.SingleValue);
            _verbose          = Application.Option("-v | --verbose", "Explicitly set 'Debug' log level.", CommandOptionType.NoValue);
            _hostPid          = Application.Option("-hpid | --hostPID", "Host process ID.", CommandOptionType.SingleValue);
            _zeroBasedIndices = Application.Option("-z | --zero-based-indices", "Use zero based indices in request/responses (defaults to 'false').", CommandOptionType.NoValue);
            _plugin           = Application.Option("-pl | --plugin", "Plugin name(s).", CommandOptionType.MultipleValue);
            _debug            = Application.Option("-d | --debug", "Wait for debugger to attach", CommandOptionType.NoValue);
        }
コード例 #2
0
 /// <summary>
 /// Adds the verbose option with the template <c>-v|--verbose</c>.
 /// </summary>
 /// <param name="app"></param>
 /// <param name="template" />
 /// <returns></returns>
 public static CommandOption VerboseOption(this CommandLineApplication app, string template)
 => app.Option(template, "Show verbose output", CommandOptionType.NoValue, inherited: true);