-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Ability to ignore unknown flags #623
Comments
I have a use for this as well. I have a wrapper for kubernetes CLI tools like kubectl and helm, and I need to parse the context flag, and ignore the other flags. Currently I'm using Python's parse_known_args(). |
I have got this working on with changes to pflag and cobra in my vendor directory, but changes are really ugly Once i have some more time i will try to make them less ugly and open pr |
I've opened spf13/pflag#160 to support unknown flags in pflag. once (and if) that PR is approved, I have changes ready for Cobra PR. |
I am trying to write something like follows:
original() {
./mycobracmd cmd1 $@
./original $@
}
I do something based on the subset of flags implemented by original command, and want to ignore rest of the flags.
Do you think this can be implemented. I will be more than happy to do a PR if acceptable.
The text was updated successfully, but these errors were encountered: