Skip to content

Commit

Permalink
(#158) Apply suggestion from Rain's review
Browse files Browse the repository at this point in the history
Be explicit with unsupported arguments so we don't accidentally warn on
packages with those names.
  • Loading branch information
corbob committed Mar 17, 2023
1 parent 865cb40 commit 525107e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ public class ChocolateyListCommand : IListCommand<PackageResult>
[Obsolete("Remove unsupported argument in V3!")]
private readonly string[] _unsupportedArguments = new[]
{
"l",
"lo",
"local",
"localonly",
"local-only",
"a",
"all",
"allversions",
"all-versions",
"order-by-popularity"
"-l",
"-lo",
"--local",
"--localonly",
"--local-only",
"-a",
"--all",
"--allversions",
"--all-versions",
"--order-by-popularity"
};

public ChocolateyListCommand(IChocolateyPackageService packageService)
Expand Down Expand Up @@ -117,7 +117,7 @@ public virtual void handle_additional_argument_parsing(IList<string> unparsedArg

foreach (var argument in unparsedArguments)
{
if (_unsupportedArguments.Contains(argument.TrimStart('-'), StringComparer.OrdinalIgnoreCase))
if (_unsupportedArguments.Contains(argument, StringComparer.OrdinalIgnoreCase))
{
this.Log().Warn(ChocolateyLoggers.Important, @"
UNSUPPORTED ARGUMENT: Ignoring the argument {0}. This argument is unsupported for locally installed packages, and will be treated as a package name in Chocolatey CLI v3!", argument);
Expand Down

0 comments on commit 525107e

Please sign in to comment.