Support for "undefok"? #2314
josvisser66
started this conversation in
Ideas
Replies: 2 comments 4 replies
-
You can file a issue for this. I think it's a good feature. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I don't agree. In fact, I don't even understand half of what you wrote. You should probably explain it a bit more with good sample cli commands and what the output is, etc... |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The Google flags library for C++ has an interesting feature called --undefok: https://gflags.github.io/gflags/. This works as follows:
./a.out --undefok=foo,bar --foo --bar=5
does not throw an error if the binary does not understand --foo and --bar. This is useful in cloud situations where the deployment of the binary and the deployment of the command line flags have different paths that are not necessarily synchronized. Imagine you added a new flag to the binary (--foo) and press the buttons to build and distribute the new binary. Then at the same time you want to go to the deployment descriptor and add "--undefok=foo --foo" so that the new binary is configured with --foo while at the same time making sure that the old binary that might get restarted somewhere does not barf on the presence of this flag (that it does not yet understand).
Afaics Clap does not yet understand something like this, nor is there another good way to implement this. I was thinking of adding this to Clap through an option that makes a Vec behave like --undefok. Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions