Skip to content

[recovery] Unclosed contexts are ignored #7

@ljharb

Description

@ljharb

https://web.archive.org/web/20201110211135/https://github.com/substack/subarg/issues/7

filed by @fiberthrone

I've realized that in cases like the one below unclosed contexts are just ignored by subarg without any error:

subarg(['abc', '[', 'cde']) // returns { _: [ 'abc' ] }

This may cause unexpected behavior.
For example, this is a usual browserify (which uses subarg) run:

browserify app.jsx -t [ babelify --presets [ react es2015 ] ]

However, the command below will just ignore everything after the -t arg, because double brackets close a context only once.

browserify app.jsx -t [ babelify --presets [ react es2015 ]]

Should subarg inform of an error in some way in such cases?

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