diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs index 0768ef3008..8c41bbbddd 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs @@ -34,16 +34,16 @@ public class ChocolateyListCommand : IListCommand [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) @@ -117,7 +117,7 @@ public virtual void handle_additional_argument_parsing(IList 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);