Skip to content

--help shows required argument error and argument labels missing names #450

@stalep

Description

@stalep

Issue 1: --help shows validation error for required arguments

When a command has a required @Argument and the user runs command --help, aesh validates the required argument before processing the --help flag, showing an error message above the help output:

$ jbang jdk install --help
Argument 'versionOrId' requires at least 1 value, but got 0.
Usage: jbang jdk install [<options>] <versionOrId> [<existingJdkPath>]
...

Expected: --help should bypass argument validation and show clean help output without errors. Exit code should be 0, not 2.

Issue 2: Help output shows generic "Argument:" instead of the paramLabel

The help output uses a bare Argument: header for each positional argument without showing its name/label:

Argument:
                  The version or id to install

Argument:
                  Pre installed JDK path

Expected: The argument name from paramLabel should be shown:

Argument:
  <versionOrId>   The version or id to install

Argument:
  <existingJdkPath>  Pre installed JDK path

The paramLabel is set on the @Argument annotation (e.g., @Argument(paramLabel = "versionOrId", ...)) and is correctly used in the synopsis line (<versionOrId>) but not in the Arguments section body.

Context

Found in jbang (jbangdev/jbang#2453). Picocli showed clean help on --help regardless of required arguments, and displayed argument names in the detailed section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions