Beispiel #1
0
        public ToolUpdateCommand(
            ParseResult result,
            IReporter reporter = null,
            ToolUpdateGlobalOrToolPathCommand toolUpdateGlobalOrToolPathCommand = null,
            ToolUpdateLocalCommand toolUpdateLocalCommand = null)
            : base(result)
        {
            _toolUpdateLocalCommand
                = toolUpdateLocalCommand ??
                  new ToolUpdateLocalCommand(result);

            _toolUpdateGlobalOrToolPathCommand =
                toolUpdateGlobalOrToolPathCommand
                ?? new ToolUpdateGlobalOrToolPathCommand(result);

            _global   = result.ValueForOption <bool>(ToolUpdateCommandParser.GlobalOption);
            _toolPath = result.ValueForOption <string>(ToolUpdateCommandParser.ToolPathOption);
        }
Beispiel #2
0
        public ToolUpdateCommand(
            AppliedOption options,
            ParseResult result,
            IReporter reporter = null,
            ToolUpdateGlobalOrToolPathCommand toolUpdateGlobalOrToolPathCommand = null,
            ToolUpdateLocalCommand toolUpdateLocalCommand = null)
            : base(result)
        {
            _options = options ?? throw new ArgumentNullException(nameof(options));
            _toolUpdateLocalCommand
                = toolUpdateLocalCommand ??
                  new ToolUpdateLocalCommand(options, result);

            _toolUpdateGlobalOrToolPathCommand =
                toolUpdateGlobalOrToolPathCommand
                ?? new ToolUpdateGlobalOrToolPathCommand(options, result);

            _global   = options.ValueOrDefault <bool>(ToolAppliedOption.GlobalOption);
            _toolPath = options.SingleArgumentOrDefault(ToolAppliedOption.ToolPathOption);
        }