Skip to content
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

feat: added custom reset behaviours #2

Merged
merged 1 commit into from
Nov 23, 2023

Conversation

avirtopeanu-ionos
Copy link
Collaborator

@avirtopeanu-ionos avirtopeanu-ionos commented Nov 23, 2023

Users can now set some custom behaviour for resetting flags, for instance:

	CustomFlagResetBehaviour: func(flag *pflag.Flag) {
		if flag.Name == "cols" {
			flag.Value.Set("")
			return
		}
		flag.Value.Set(flag.DefValue)
	},

for example users can reset flags to no value rather than their default values
@avirtopeanu-ionos avirtopeanu-ionos merged commit 91b8171 into main Nov 23, 2023
@avirtopeanu-ionos avirtopeanu-ionos deleted the feat/custom-flag-reset-behaviour branch November 23, 2023 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant