Skip to content

printHelpOnExit doesn't work for subcommands #190

Open
@scarf005

Description

@scarf005

Reproduction

using https://github.com/com-lihaoyi/mainargs#multiple-main-methods as test.scala:

without any flags:

$ scala test.scala
Need to specify a sub command: foo, bar

with --help explicitly given:

$ scala --cli-version 1.7.1 test.scala -- --help
Available subcommands:

  foo
    --bool          Example flag
    -f --foo <str>  String to print repeatedly
    --my-num <int>  How many times to print string

  bar
    -i <int>
    -s <str>        Pass in a custom `s` to override it

Expected Behavior

printHelpOnExit: Boolean: whether or not to print the full help text when argument parsing fails. This can be convenient, but potentially very verbose if the list of arguments is long. Defaults to true

when subcommand parsing fails, the same full help message (--help) should be printed.

Additional Context

I'm interested in opening a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions