Beispiel #1
0
        public ToolInstallCommand(
            ParseResult parseResult,
            ToolInstallGlobalOrToolPathCommand toolInstallGlobalOrToolPathCommand = null,
            ToolInstallLocalCommand toolInstallLocalCommand = null)
            : base(parseResult)
        {
            _toolInstallLocalCommand =
                toolInstallLocalCommand
                ?? new ToolInstallLocalCommand(_parseResult);

            _toolInstallGlobalOrToolPathCommand =
                toolInstallGlobalOrToolPathCommand
                ?? new ToolInstallGlobalOrToolPathCommand(_parseResult);

            _global    = parseResult.GetValueForOption(ToolAppliedOption.GlobalOption);
            _local     = parseResult.GetValueForOption(ToolAppliedOption.LocalOption);
            _toolPath  = parseResult.GetValueForOption(ToolAppliedOption.ToolPathOption);
            _framework = parseResult.GetValueForOption(ToolInstallCommandParser.FrameworkOption);
        }
Beispiel #2
0
        public ToolInstallCommand(
            AppliedOption appliedCommand,
            ParseResult parseResult,
            ToolInstallGlobalOrToolPathCommand toolInstallGlobalOrToolPathCommand = null,
            ToolInstallLocalCommand toolInstallLocalCommand = null)
            : base(parseResult)
        {
            _appliedCommand          = appliedCommand ?? throw new ArgumentNullException(nameof(appliedCommand));
            _parseResult             = parseResult ?? throw new ArgumentNullException(nameof(parseResult));
            _toolInstallLocalCommand =
                toolInstallLocalCommand
                ?? new ToolInstallLocalCommand(_appliedCommand, _parseResult);

            _toolInstallGlobalOrToolPathCommand =
                toolInstallGlobalOrToolPathCommand
                ?? new ToolInstallGlobalOrToolPathCommand(_appliedCommand, _parseResult);

            _global    = appliedCommand.ValueOrDefault <bool>(ToolAppliedOption.GlobalOption);
            _local     = appliedCommand.ValueOrDefault <bool>(ToolAppliedOption.LocalOption);
            _toolPath  = appliedCommand.SingleArgumentOrDefault(ToolAppliedOption.ToolPathOption);
            _framework = appliedCommand.ValueOrDefault <string>("framework");
        }