Skip to content

halt-at-non-option is incompatible with unknown-options-as-args #437

@kherock

Description

@kherock

Enabling unknown-options-as-args seems to short-circuit the code that would set notFlags to the remaining arguments after checking if halt-at-non-option is enabled:

if (arg !== '--' && isUnknownOptionAsArg(arg)) {
pushPositional(arg)

I see several instances where isUnknownOptionAsArg is guarded with a basic check for /^-/.test(arg). Would it be naive to suggest that updating the condition to arg !== '--' && /^-/.test(arg) && isUnknownOptionAsArg(arg) should fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions