Is there a way to accept only unknown options and not unknown arguments?

19 Views Asked by At

With subcommands, the root command cannot accept unknown arguments because the application would think they're subcommands, but it should theoretically still be able to accept an unknown number of options; however, using something like @click.argument("args", nargs=-1) on the root command would accept both arguments and options, rendering the subcommands unusable.

Is there any way to accept only the unknown options, and treat the arguments as subcommands?

0

There are 0 best solutions below