cmd-kola: transparently pass unknown flags to kola #1058
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Right now we're kind of in a messy situtation where we have some args
for
cosa kola
, and other args that we want to pass through tokola
.Unfortunately, argparse isn't very good for this use case. Using
--
helps sometimes, but the issue arises when we want to pass flags to
both cosa and kola. The obvious
--cosa-arg -- --kola-arg
doesn'twork (https://bugs.python.org/issue15112).
Instead, just use
parse_known_args()
to tell argparse to leave theunknown args untouched. We then pass those through as is to
kola
. Thisalso avoids us having to use
--
entirely. The caveat is that it can beconfusing if we support a
cosa kola
arg thatkola
natively supports,but let's say we're not going to do this, or if we do, it's to just pass
it through to kola as well as do some auxiliary related thing.