diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyInfoCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyInfoCommand.cs index 04e4c8a2d..d7ee4e97e 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyInfoCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyInfoCommand.cs @@ -38,10 +38,7 @@ public override void ConfigureArgumentParser(OptionSet optionSet, ChocolateyConf .Add( "s=|source=", "Source - Source location for install. Can use special 'windowsfeatures', 'ruby', 'cygwin', or 'python' sources. Defaults to configured sources.", - option => { - configuration.Sources = configuration.ExplicitSources = option.UnquoteSafe(); - configuration.ListCommand.ExplicitSource = true; - }) + option => configuration.Sources = configuration.ExplicitSources = option.UnquoteSafe()) .Add( "l|lo|localonly|local-only", "LocalOnly - Only search against local machine items.", diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs index eae87ebd9..2ca1c0c5a 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs @@ -53,11 +53,7 @@ public virtual void ConfigureArgumentParser(OptionSet optionSet, ChocolateyConfi optionSet .Add("s=|source=", "Source - The source to find the package(s) to install. Special sources include: ruby, cygwin, windowsfeatures, and python. To specify more than one source, pass it with a semi-colon separating the values (e.g. \"'source1;source2'\"). Defaults to default feeds.", - option => - { - configuration.Sources = configuration.ExplicitSources = option.UnquoteSafe(); - configuration.ListCommand.ExplicitSource = true; - }) + option => configuration.Sources = configuration.ExplicitSources = option.UnquoteSafe()) .Add("version=", "Version - A specific version to install. Defaults to unspecified.", option => configuration.Version = option.UnquoteSafe()) diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs index 5fc100df5..a7cd59468 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs @@ -252,7 +252,7 @@ public virtual void Run(ChocolateyConfiguration config) { // Would have liked to have done this in the Validate method, but can't, since the SourceType // hasn't yet been set, since the sources have not yet been parsed. - if (config.ListCommand.ExplicitSource && config.SourceType == SourceTypes.Normal) + if (!string.IsNullOrWhiteSpace(config.ExplicitSources) && config.SourceType == SourceTypes.Normal) { throw new ApplicationException("When using the '--source' option with the 'choco list' command, only a named alternative source can be provided."); } diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyOutdatedCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyOutdatedCommand.cs index b4f8f4ebe..6c6b46f42 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyOutdatedCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyOutdatedCommand.cs @@ -40,11 +40,7 @@ public virtual void ConfigureArgumentParser(OptionSet optionSet, ChocolateyConfi optionSet .Add("s=|source=", "Source - The source to find the package(s) to install. Special sources include: ruby, cygwin, windowsfeatures, and python. To specify more than one source, pass it with a semi-colon separating the values (e.g. \"'source1;source2'\"). Defaults to default feeds.", - option => - { - configuration.Sources = configuration.ExplicitSources = option.UnquoteSafe(); - configuration.ListCommand.ExplicitSource = true; - }) + option => configuration.Sources = configuration.ExplicitSources = option.UnquoteSafe()) .Add("u=|user=", "User - used with authenticated feeds. Defaults to empty.", option => configuration.SourceCommand.Username = option.UnquoteSafe()) diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateySearchCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateySearchCommand.cs index ee80059d0..34acb867e 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateySearchCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateySearchCommand.cs @@ -43,11 +43,7 @@ public virtual void ConfigureArgumentParser(OptionSet optionSet, ChocolateyConfi optionSet .Add("s=|source=", "Source - Source location for install. Can use special 'windowsfeatures', 'ruby', 'cygwin', or 'python' sources. Defaults to sources.", - option => - { - configuration.Sources = configuration.ExplicitSources = option.UnquoteSafe(); - configuration.ListCommand.ExplicitSource = true; - }) + option => configuration.Sources = configuration.ExplicitSources = option.UnquoteSafe()) .Add("idonly|id-only", "Id Only - Only return Package Ids in the list results.", option => configuration.ListCommand.IdOnly = option != null) diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs index f83500a27..04206f592 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs @@ -53,11 +53,7 @@ public virtual void ConfigureArgumentParser(OptionSet optionSet, ChocolateyConfi optionSet .Add("s=|source=", "Source - The source to find the package(s) to install. Special sources include: ruby, cygwin, windowsfeatures, and python. To specify more than one source, pass it with a semi-colon separating the values (e.g. \"'source1;source2'\"). Defaults to default feeds.", - option => - { - configuration.Sources = configuration.ExplicitSources = option.UnquoteSafe(); - configuration.ListCommand.ExplicitSource = true; - }) + option => configuration.Sources = configuration.ExplicitSources = option.UnquoteSafe()) .Add("version=", "Version - A specific version to install. Defaults to unspecified.", option => configuration.Version = option.UnquoteSafe()) diff --git a/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs b/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs index b823cf6d3..9954353c4 100644 --- a/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs +++ b/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs @@ -603,6 +603,7 @@ public ListCommandConfiguration() public bool NotBroken { get; set; } public bool IncludeVersionOverrides { get; set; } public bool ExplicitPageSize { get; set; } + [Obsolete("This property is deprecated and will be removed in v3. Check if the top-level ExplicitSources property is set instead.")] public bool ExplicitSource { get; set; } }