Exemple #1
0
        public ToolUninstallCommand(
            ParseResult result,
            IReporter reporter = null,
            ToolUninstallGlobalOrToolPathCommand toolUninstallGlobalOrToolPathCommand = null,
            ToolUninstallLocalCommand toolUninstallLocalCommand = null)
            : base(result)
        {
            _toolUninstallLocalCommand
                = toolUninstallLocalCommand ??
                  new ToolUninstallLocalCommand(result);

            _toolUninstallGlobalOrToolPathCommand =
                toolUninstallGlobalOrToolPathCommand
                ?? new ToolUninstallGlobalOrToolPathCommand(result);

            _global   = result.ValueForOption <bool>(ToolUninstallCommandParser.GlobalOption);
            _toolPath = result.ValueForOption <string>(ToolUninstallCommandParser.ToolPathOption);
        }
        public ToolUninstallCommand(
            AppliedOption options,
            ParseResult result,
            IReporter reporter = null,
            ToolUninstallGlobalOrToolPathCommand toolUninstallGlobalOrToolPathCommand = null,
            ToolUninstallLocalCommand toolUninstallLocalCommand = null)
            : base(result)
        {
            _options = options ?? throw new ArgumentNullException(nameof(options));
            _toolUninstallLocalCommand
                = toolUninstallLocalCommand ??
                  new ToolUninstallLocalCommand(options, result);

            _toolUninstallGlobalOrToolPathCommand =
                toolUninstallGlobalOrToolPathCommand
                ?? new ToolUninstallGlobalOrToolPathCommand(options, result);

            _global   = options.ValueOrDefault <bool>(ToolAppliedOption.GlobalOption);
            _toolPath = options.SingleArgumentOrDefault(ToolAppliedOption.ToolPathOption);
        }
        public ToolUninstallCommand(
            AppliedOption options,
            ParseResult result,
            IReporter reporter = null,
            ToolUninstallGlobalOrToolPathCommand toolUninstallGlobalOrToolPathCommand = null,
            ToolUninstallLocalCommand toolUninstallLocalCommand = null)
            : base(result)
        {
            _toolUninstallLocalCommand
                = toolUninstallLocalCommand ??
                  new ToolUninstallLocalCommand(options, result);

            _toolUninstallGlobalOrToolPathCommand =
                toolUninstallGlobalOrToolPathCommand
                ?? new ToolUninstallGlobalOrToolPathCommand(options, result);

            _global             = options.ValueOrDefault <bool>(GlobalOption);
            _local              = options.ValueOrDefault <bool>(LocalOption);
            _toolPath           = options.SingleArgumentOrDefault(ToolPathOption);
            _toolManifestOption = options.ValueOrDefault <string>("tool-manifest");
        }