Exemplo n.º 1
0
        public override int Execute()
        {
            ToolAppliedOption.EnsureNoConflictGlobalLocalToolPathOption(
                _parseResult,
                LocalizableStrings.InstallToolCommandInvalidGlobalAndLocalAndToolPath);

            ToolAppliedOption.EnsureToolManifestAndOnlyLocalFlagCombination(
                _parseResult);

            if (_global || !string.IsNullOrWhiteSpace(_toolPath))
            {
                return(_toolInstallGlobalOrToolPathCommand.Execute());
            }
            else
            {
                if (!string.IsNullOrWhiteSpace(_framework))
                {
                    throw new GracefulException(
                              string.Format(
                                  LocalizableStrings.LocalOptionDoesNotSupportFrameworkOption));
                }

                return(_toolInstallLocalCommand.Execute());
            }
        }
Exemplo n.º 2
0
        public override int Execute()
        {
            ToolAppliedOption.EnsureNoConflictGlobalLocalToolPathOption(
                _parseResult,
                LocalizableStrings.ListToolCommandInvalidGlobalAndLocalAndToolPath);

            if (_parseResult.ValueForOption <bool>(ToolListCommandParser.GlobalOption) ||
                _parseResult.HasOption(ToolListCommandParser.ToolPathOption))
            {
                return(_toolListGlobalOrToolPathCommand.Execute());
            }
            else
            {
                return(_toolListLocalCommand.Execute());
            }
        }
Exemplo n.º 3
0
        public override int Execute()
        {
            ToolAppliedOption.EnsureNoConflictGlobalLocalToolPathOption(
                _options,
                LocalizableStrings.ListToolCommandInvalidGlobalAndLocalAndToolPath);

            if (_options.ValueOrDefault <bool>(ToolAppliedOption.GlobalOption) ||
                !string.IsNullOrWhiteSpace(_options.SingleArgumentOrDefault(ToolAppliedOption.ToolPathOption)))
            {
                return(_toolListGlobalOrToolPathCommand.Execute());
            }
            else
            {
                return(_toolListLocalCommand.Execute());
            }
        }
Exemplo n.º 4
0
        public override int Execute()
        {
            ToolAppliedOption.EnsureNoConflictGlobalLocalToolPathOption(
                _parseResult,
                LocalizableStrings.UpdateToolCommandInvalidGlobalAndLocalAndToolPath);

            ToolAppliedOption.EnsureToolManifestAndOnlyLocalFlagCombination(_parseResult);

            if (_global || !string.IsNullOrWhiteSpace(_toolPath))
            {
                return(_toolUpdateGlobalOrToolPathCommand.Execute());
            }
            else
            {
                return(_toolUpdateLocalCommand.Execute());
            }
        }
Exemplo n.º 5
0
        public static Command GetCommand()
        {
            var command = new Command("install", LocalizableStrings.CommandDescription);

            command.AddArgument(PackageIdArgument);
            command.AddOption(ToolAppliedOption.GlobalOption(LocalizableStrings.GlobalOptionDescription));
            command.AddOption(ToolAppliedOption.LocalOption(LocalizableStrings.LocalOptionDescription));
            command.AddOption(ToolAppliedOption.ToolPathOption(LocalizableStrings.ToolPathOptionDescription, LocalizableStrings.ToolPathOptionName));
            command.AddOption(VersionOption);
            command.AddOption(ConfigOption);
            command.AddOption(ToolAppliedOption.ToolManifestOption(LocalizableStrings.ManifestPathOptionDescription, LocalizableStrings.ManifestPathOptionName));
            command.AddOption(AddSourceOption);
            command.AddOption(FrameworkOption);
            command.AddOption(ToolCommandRestorePassThroughOptions.DisableParallelOption);
            command.AddOption(ToolCommandRestorePassThroughOptions.IgnoreFailedSourcesOption);
            command.AddOption(ToolCommandRestorePassThroughOptions.NoCacheOption);
            command.AddOption(ToolCommandRestorePassThroughOptions.InteractiveRestoreOption);
            command.AddOption(VerbosityOption);

            return(command);
        }