Skip to content

Commit

Permalink
(chocolateyGH-994) Add ignore-pinned switch to outdated command.
Browse files Browse the repository at this point in the history
Previously the 'choco outdated' command listed all packages regardless
of whether they were pinned or not. Add an 'ignore-pinned' switch that
skips checking available upgrades for all packages that are pinned.
  • Loading branch information
Paul Hunt committed Jan 4, 2017
1 parent 9130ab4 commit e3d3cba
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ $commandOptions = @{
info = "--pre --lo --source='' --user= --password= --local-only --prerelease" + $allcommands
install = "-y -whatif -? --pre --version= --params='' --install-arguments='' --override-arguments --ignore-dependencies --source='' --source='windowsfeatures' --source='webpi' --user= --password= --prerelease --forcex86 --not-silent --package-parameters='' --allow-downgrade --force-dependencies --require-checksums --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --allow-multiple-versions --ignore-checksums --allow-empty-checksums --allow-empty-checksums-secure --download-checksum='' --download-checksum-type='' --download-checksum-x64='' --download-checksum-type-x64=''" + $allcommands + $proInstallUpgradeOptions
pin = "--name= --version= -?" + $allcommands
outdated = "-? --source='' --user= --password=" + $allcommands
outdated = "-? --source='' --user= --password= --ignore-pinned" + $allcommands
upgrade = "-y -whatif -? --pre --version= --except='' --params='' --install-arguments='' --override-arguments --ignore-dependencies --source='' --source='windowsfeatures' --source='webpi' --user= --password= --prerelease --forcex86 --not-silent --package-parameters='' --allow-downgrade --allow-multiple-versions --require-checksums --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --fail-on-unfound --fail-on-not-installed --ignore-checksums --allow-empty-checksums --allow-empty-checksums-secure --download-checksum='' --download-checksum-type='' --download-checksum-x64='' --download-checksum-type-x64=''" + $allcommands + $proInstallUpgradeOptions
uninstall = "-y -whatif -? --force-dependencies --remove-dependencies --all-versions --source='windowsfeatures' --source='webpi' --version= --uninstall-arguments='' --override-arguments --not-silent --params='' --package-parameters='' --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --use-autouninstaller --skip-autouninstaller --fail-on-autouninstaller --ignore-autouninstaller-failure" + $allcommands
new = "--template-name= --file='Biz editions only' --automaticpackage --version= --maintainer='' packageversion= maintainername='' maintainerrepo='' installertype= url='' url64='' silentargs='' --use-built-in-template -?" + $allcommands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,6 @@ public void should_add_ignore_pinned_to_the_option_set()
{
optionSet.Contains("ignore-pinned").ShouldBeTrue();
}

[Fact]
public void should_add_short_version_of_ignore_pinned_to_the_option_set()
{
optionSet.Contains("ip").ShouldBeTrue();
}
}

public class when_noop_is_called : ChocolateyOutdatedCommandSpecsBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public virtual void configure_argument_parser(OptionSet optionSet, ChocolateyCon
.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("ip|ignore-pinned",
.Add("ignore-pinned",
"IgnorePinned - Ignore pinned packages. Defaults to false.",
option => configuration.OutdatedCommand.IgnorePinned = option != null)
;
Expand Down

0 comments on commit e3d3cba

Please sign in to comment.