pyinvoke / invoke

Pythonic task management & command execution.
http://pyinvoke.org
BSD 2-Clause "Simplified" License
4.32k stars 365 forks source link

Python interpreter CLI options #890

Open YuriOsokin opened 1 year ago

YuriOsokin commented 1 year ago

I would like to add python interpreter options, such as -OO during the invoke call. However, I did not find a way other then patch the invoke (and inv) scripts in venv manually. Am I missing something?

D3f0 commented 1 year ago

@YuriOsokin you can call invoke as a package with -m invoke.

So in order to pass the arguments to the interpreter, just prefix your invoke call like this:

python -OO -m invoke my_task

You can create an alias for the fixed part in your shell of choice, bash, zsh or an abbreviation in fish or xonsh (not sure how this work on windowsland).