Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd-kola: transparently pass unknown flags to kola
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 to `kola`. 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't work (https://bugs.python.org/issue15112). Instead, just use `parse_known_args()` to tell argparse to leave the unknown args untouched. We then pass those through as is to `kola`. This also avoids us having to use `--` entirely. The caveat is that it can be confusing if we support a `cosa kola` arg that `kola` 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.
- Loading branch information