-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
step cli flags with aliases sometimes report a different alias in error messages #821
Comments
Hey @weaversam8 馃憢. Thanks for opening the issue! First off, you're totally right, and this has also confused me multiple times. Second, for anyone reading this, we would definitely accept a PR to resolve this, as long as the PR didn't replace the underlying flag library that is being used (this would be a much broader change). |
I did some analysis for this. From what I have understood, I think the information about which flag alias was passed on the command line is lost after the parsing of command line is complete. The flag data structure, in which the data about the flag passed on the command line lies, does not have any information about what was passed on command line. Also, neither of the structs |
Hello!
Issue details
When using the
step ssh proxycommand
command in step CLI, I tried to configure a--provisioner
flag, but accidentally provided the wrong provisioner name. When I did so, the error message I received was:This initially confused me, as I didn't realize that
--issuer
and--provisioner
are aliases for the same flag:cli/flags/flags.go
Lines 156 to 160 in 160bd07
Error messages should provide the name of the flag that was used, not the name of an alias that was not used.
Why is this needed?
Inaccurate error messages are misleading and can cause a developer to believe they've made a mistake in a location other than the actual source of the problem.
The text was updated successfully, but these errors were encountered: