Skip to content

argparse says argument is optional when it's required #8055

Open
@rlipscombe

Description

@rlipscombe

Describe the bug
Usage text for 'required' arguments has them listed under "Optional arguments".

To Reproduce

cli() ->
    #{
        arguments => [
            #{
                name => server,
                long => "-server",
                % Note 'required'
                required => true,
                nargs => nonempty_list,
                action => extend,
                type => {custom, fun parse_server/1}
            }
        ],
        % ...

Usage reads thus:

...
Optional arguments:
  --server server

Expected behavior

Usage should probably read thus:

...
Required arguments:
  --server server

Affected versions

OTP-26.2.1

Metadata

Metadata

Assignees

Labels

bugIssue is reported as a bughelp wantedIssue not worked on by OTP; help wanted from the communityteam:VMAssigned to OTP team VM

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions