Context
arg_parse currently accepts the next argument as the value for a value option unless the next argument is missing or exactly --. It does not check whether the next token is itself a registered option.
Failure Scenario
With specs such as output|value|--output and verbose|flag|--verbose, this call succeeds incorrectly:
arg_parse options positionals specs -- --output --verbose
The parser stores options[output]=--verbose and never sets the verbose flag.
Scope
- When a value option consumes the following token, reject the value if it is a known option token.
- Preserve legitimate option-like values that are not registered options, unless the existing API explicitly forbids them.
- Add BATS coverage for a value option followed by a registered flag/value token.
Acceptance Criteria
--output --verbose returns usage status instead of consuming --verbose as the output value.
- Unknown option-like strings used as values keep the current documented behavior.
./tests/validate.sh passes.
Validation
Context
arg_parsecurrently accepts the next argument as the value for a value option unless the next argument is missing or exactly--. It does not check whether the next token is itself a registered option.Failure Scenario
With specs such as
output|value|--outputandverbose|flag|--verbose, this call succeeds incorrectly:The parser stores
options[output]=--verboseand never sets the verbose flag.Scope
Acceptance Criteria
--output --verbosereturns usage status instead of consuming--verboseas the output value../tests/validate.shpasses.Validation
./tests/validate.sh