pyinvoke / invoke

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

`--help` after the command treats `--help` as positional argument #982

Open scottopell opened 8 months ago

scottopell commented 8 months ago

I have a repro where --help is incorrectly treated as a positional arg instead of triggering the invoke command help printout. https://github.com/scottopell/invoke-help-bug

I've read through #205 and from what I understand this is not expected, --help and other core flags should be parsed out before task execution from what I understand.

Are there any suggested workarounds? Or is this unavoidable when the task takes positional arguments?

cupen commented 5 months ago

I can fix it. but I don't like invoke --help taskname, why not just invoke taskname --help. It's more *nix style, which is default case in most scenarios.

tonygoldman commented 4 months ago

Agreed! invoke taskname --help should be the standard.