Missing required flag error uses alias #1701
Labels
area/v2
relates to / is being considered for v2
kind/bug
describes or fixes a bug
status/triage
maintainers still need to look into this
My urfave/cli version is
v2.25.0
Checklist
Dependency Management
Describe the bug
The error message for a missing required flag uses the alias instead of the main flag name, which is not untrue, but confusing.
To reproduce
Observed behavior
Expected behavior
Additional context
It seems like checkRequiredFlags is iterating over the the flag names (which is the append(name, aliases...)) and sets
flagName = key
. After the loop is over,flagName
is the last alias.Want to fix this yourself?
I can submit a PR if you want, but according to the guidelines you are not accepting v2 fixes. Let me know if this is ok, and I'll move forward with a fix.
A fix could be:
Run
go version
and paste its output hereRun
go env
and paste its output hereThe text was updated successfully, but these errors were encountered: