You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
The text was updated successfully, but these errors were encountered:
rmorshea
changed the title
Recommended way to forward arguments to
Recommended way to forward arguments to commands
May 29, 2024
fab -c tasks -H localhost forward-args -- "a '1 2'"
...
fabric.exceptions.NothingToDo: Was told to run a command, but not given any hosts to run it on!
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
.The text was updated successfully, but these errors were encountered: