It'd like to know the recommended way to forward arguments to a command. For example, I have a test task that runs PyTest and I'd like to forward any extra arguments along to pytest. The best way I've found to do this is delimit my task's arguments from those of pytest with --. If I do this invoke seems to ignore all the following arguments. Ultimately this means I can do the following:
invoke test -- test_something.py::test_feature --maxfail=2
While this works, I searched through the documentation and even a bit of the code, but didn't see anything that would explicitly allow for this sort of "argument forwarding" pattern. Is this behavior intended or is there a better way to achieve this? If it is something that invoke intentionally supports, perhaps these extra args (everything following --) could be attached to the Context.
It'd like to know the recommended way to forward arguments to a command. For example, I have a
test
task that runs PyTest and I'd like to forward any extra arguments along topytest
. The best way I've found to do this is delimit my task's arguments from those ofpytest
with--
. If I do thisinvoke
seems to ignore all the following arguments. Ultimately this means I can do the following:Where usage could then be:
While this works, I searched through the documentation and even a bit of the code, but didn't see anything that would explicitly allow for this sort of "argument forwarding" pattern. Is this behavior intended or is there a better way to achieve this? If it is something that
invoke
intentionally supports, perhaps these extra args (everything following--
) could be attached to theContext
.