cli: unknown flag errors cleanup #8625
Labels
component:cli
Affects the Argo CD CLI
enhancement
New feature or request
type:usability
Enhancement of an existing feature
Summary
When I use an invalid flag with the argocd cli, I get the following output:
The help output can be distracting and make it difficult to find the error.
Additionally, the error message is shown twice (once toward the top as
Error: unknown shorthand flag: 'l' in -l
, then at the bottom asunknown shorthand flag: 'l' in -l
.)Motivation
If I ever make a flag typo when running a command.
Proposal
I think it would make sense to enable
SilenceUsage
from the the root command here. This would stop showing all the help information for a command when the error occurs.I also think it's not necessary to print the error message here. The error should be surfaced before this point.
With the changes above, the command output would change to as follows:
The text was updated successfully, but these errors were encountered: