Skip to content

Commit

Permalink
(GH-1831) list/search/info - disabe repo opts switch
Browse files Browse the repository at this point in the history
Ensure that when running search, list, or info, there is a switch to
disable the repository optimizations when they are not available.
  • Loading branch information
ferventcoder committed May 26, 2019
1 parent 97a171f commit 36f7182
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ public override void configure_argument_parser(OptionSet optionSet, ChocolateyCo
.Add("cp=|certpassword=",
"Certificate Password - the client certificate's password to the source. Defaults to empty. Available in 0.9.10+.",
option => configuration.SourceCommand.CertificatePassword = option.remove_surrounding_quotes())
.Add("disable-repository-optimizations|disable-package-repository-optimizations",
"Disable Package Repository Optimizations - Do not use optimizations for reducing bandwidth with repository queries during package install/upgrade/outdated operations. Should not generally be used, unless a repository needs to support older methods of query. When used, this makes queries similar to the way they were done in Chocolatey v0.10.11 and before. Overrides the default feature '{0}' set to '{1}'. Available in 0.10.14+.".format_with
(ApplicationParameters.Features.UsePackageRepositoryOptimizations, configuration.Features.UsePackageRepositoryOptimizations.to_string()),
option =>
{
if (option != null)
{
configuration.Features.UsePackageRepositoryOptimizations = false;
}
})
;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ public virtual void configure_argument_parser(OptionSet optionSet, ChocolateyCon
.Add("detail|detailed",
"Detailed - Alias for verbose. Available in 0.9.10+.",
option => configuration.Verbose = option != null)
.Add("disable-repository-optimizations|disable-package-repository-optimizations",
"Disable Package Repository Optimizations - Do not use optimizations for reducing bandwidth with repository queries during package install/upgrade/outdated operations. Should not generally be used, unless a repository needs to support older methods of query. When disabled, this makes queries similar to the way they were done in Chocolatey v0.10.11 and before. Overrides the default feature '{0}' set to '{1}'. Available in 0.10.14+.".format_with
(ApplicationParameters.Features.UsePackageRepositoryOptimizations, configuration.Features.UsePackageRepositoryOptimizations.to_string()),
option =>
{
if (option != null)
{
configuration.Features.UsePackageRepositoryOptimizations = false;
}
})
;
}

Expand Down

0 comments on commit 36f7182

Please sign in to comment.