-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support IsSet() method on flags #453
Comments
You can use Changed func to check it: if cmd.Flags().Changed("someFlag") {
// user set the flag
} |
Thanks! That worked. |
1 task
Shall we also provide a function like: func (f *FlagSet) GetChangedList() []string So we could register a handler map to process the corresponding flags. |
@xieyuschen that would be nice |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To distinguish when the flag got default value because user didnt set any or user explicitly set the flag to same value as the default value.
The text was updated successfully, but these errors were encountered: