-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Misleading shorthand flag panic message #1987
Copy link
Copy link
Closed
spf13/pflag
#381Labels
area/flags-argsChanges to functionality around command line flags and argsChanges to functionality around command line flags and argsgood-first-issueIssues that a new contributor could make a PR forIssues that a new contributor could make a PR forlifecycle/needs-prReady for a PR from the communityReady for a PR from the community
Metadata
Metadata
Assignees
Labels
area/flags-argsChanges to functionality around command line flags and argsChanges to functionality around command line flags and argsgood-first-issueIssues that a new contributor could make a PR forIssues that a new contributor could make a PR forlifecycle/needs-prReady for a PR from the communityReady for a PR from the community
Adding a BoolVarP with shorthand code of "h" to any flagset generates a misleading panic message:
The error makes it seem like the issue is with the "mapgen" flagset (in this example) when it's actually from the default help flagset.
To recreate, add a BoolVarP to the root command and then run the command with no arguments.
This is with v1.0.5.