Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
scottopell opened this issue Jan 9, 2024 · 3 comments
Open

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

scottopell opened this issue Jan 9, 2024 · 3 comments

Comments

@scottopell
Copy link

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
Copy link

cupen commented Apr 26, 2024

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
Copy link

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

@bitprophet
Copy link
Member

This used to work (99% certainty) but has been broken for quite some time. It definitely should work! I have to take a look at the gnarly old guts of the parser to see why it's broken and how it can be fixed.

It will probably come down to a judgement call - if a token could be either a positional value or a flag, we will assume it's a flag, because that is obviously the more common/likely case.

(Suppose we could afterwards add an argument to @task for folks who very badly want to override that behavior to how it currently behaves, but, eh.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants