Skip to content

Fix string option parsing with nopt v9 - #11018

Closed
2005rishabh wants to merge 1 commit into
ember-cli:masterfrom
2005rishabh:nopt-upgrade
Closed

Fix string option parsing with nopt v9#11018
2005rishabh wants to merge 1 commit into
ember-cli:masterfrom
2005rishabh:nopt-upgrade

Conversation

@2005rishabh

Copy link
Copy Markdown

I investigated the nopt@9 regression and narrowed the issue down to parsing string option values that begin with --.

nopt@9 interprets those values as additional flags instead of string values, which breaks cases like:

--options "--split 2 --random"

The fix adds a small compatibility layer in parseArgs() that temporarily masks string option values beginning with -- during parsing and restores them afterward.

Verified locally with:

  • tests/unit/models/command-test.js
  • relevant acceptance tests (ember new uses yarn when blueprint has yarn.lock)

Current local result:

  • 173 passing
  • 0 failing

@NullVoxPopuli

Copy link
Copy Markdown
Contributor

what's the regression? I'm not familiar

@mansona

mansona commented May 8, 2026

Copy link
Copy Markdown
Member

@NullVoxPopuli I think regression is the wrong word here. I tried updating to the latest version and it was failing for some unknown reason #11010

@2005rishabh would you not be better to target the branch that updated the nopt version? 🤔 I don't see how making this change on main would help

@2005rishabh

Copy link
Copy Markdown
Author

You're right — this compatibility fix only makes sense alongside the existing nopt@9 upgrade work.

I'll retarget the changes onto the nopt upgrade branch and update the PR.

@2005rishabh 2005rishabh closed this May 9, 2026
@2005rishabh

Copy link
Copy Markdown
Author

Closing this in favor of a PR targeting the existing nopt upgrade branch.

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.

3 participants