镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Description

@scottopell

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?

Activity

  1. cupen commented on Apr 26, 2024

    @cupen

    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.

  2. tonygoldman commented on May 15, 2024

    @tonygoldman

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

  3. bitprophet commented on Oct 18, 2024

    @bitprophet
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions