Skip to content

Enable default value and help text when parsing multiple values #6

Closed
@JordanMartinez

Description

@JordanMartinez

To parse a single value that has a default value, I'll usually use a regular option rather than an argument: strOption (long "arg-name" <> value "default" <> help "help text" <> ...)

To parse multiple values, I need to use an argument: some $ argument str $ metavar "FILES..."

However, the multi-value parser removes the help text option and does not allow me to specify a default value.

How can I re-add that support?

Full context: I'm migrating from Yargs to this library since the former has a high severity warning when NPM audits its dependencies. (JordanMartinez/purescript-jordans-reference#315). Yargs allows one to specify an array of values (with a default value) that I used in my ToC generator program. This capability isn't strictly necessary, but I'd prefer to not have to drop support for it.

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