Skip to content

ARG_OPTIONAL_REPEATED always appends to the defaults rather than replacing #12

Closed
@sgallagher

Description

@sgallagher

The documentation for ARG_OPTIONAL_REPEATED reads:

The default default is an empty array. The argument can be repeated multiple times, but instead of the later specifications overriding earlier ones (s.a. ARG_OPTIONAL_SINGLE does), arguments are gradually appended to an array. The form of the default is what you normally put between the brackets when you create bash arrays, so put whitespace-separated values in there

The other options for argbash will supersede their defaults, but the effect of using the default option in ARG_OPTIONAL_REPEATED means that this set of values will always be present in the resulting list and that the arguments specified at the command-line merely supplement them.

Either the documentation should reflect this behavior or it should be changed to behave more similarly to the other options.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions