Skip to content

Conversation

@bjornstar
Copy link
Collaborator

Fixes #258

node has particular CLI usage patterns that are not supported by minimist. specifically, --inspect which has either no option or must include =.

I've added specific support for inspect & r / require. Unknown argument should be passed on to node.

We now throw if we cannot identify the script portion of the command line arguments. In the future we can instead list the command line arguments when this happens.

The way this now works is we manually handle the inspect options and remove them before passing the args off to minimist. We parse once with minimist to determine the location of the script and then parse again with the default values that we find in that script's directory.

I'll release this with a major version bump as I'm not 100% certain I covered all the use cases out there.

@bjornstar bjornstar merged commit cd091f6 into fgnass:master May 4, 2021
@bjornstar bjornstar deleted the improve-cli branch May 4, 2021 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Argument parsing is still broken in 6.7.0 (-r works but --require doesn't)

1 participant