Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Parsing issues for options within a string on 4.0.x+ #80

Open
calderas opened this issue Apr 27, 2017 · 0 comments
Open

[BUG] Parsing issues for options within a string on 4.0.x+ #80

calderas opened this issue Apr 27, 2017 · 0 comments
Labels
Bug thing that needs fixing

Comments

@calderas
Copy link

calderas commented Apr 27, 2017

Original issue: ember-cli/ember-cli#6970
Parsing options issues for a string with "options"
node test.js foo bar --options '--split 2 --random'

Issue after: 651d447.
https://regex101.com/r/aoa7GZ/1

Example test.js:

var nopt = require("nopt")
var knownOpts = { options: String };
var parsed = nopt( knownOpts, {}, process.argv, 0)
console.log("parsed: ", parsed);
console.log("parsed.options: ", parsed.options);

3.0.x

node test.js foo bar --options '--split 2 --random'

parsed:  { options: '--split 2 --random',
  argv: 
   { remain: [],
     cooked: [ '--options', '--split 2 --random' ],
     original: [ '--options', '--split 2 --random' ] } }

parsed.options: --split 2 --random

4.0.X:

node test.js foo bar --options '--split 2 --random'

parsed:  { options: '',
  'split 2 --random': true,
  argv: 
   { remain: [],
     cooked: [ '--options', '--split 2 --random' ],
     original: [ '--options', '--split 2 --random' ] } }

parsed.options:

@darcyclarke darcyclarke changed the title Parsing issues for options within a string on 4.0.x+ [BUG] Parsing issues for options within a string on 4.0.x+ Jul 28, 2022
@darcyclarke darcyclarke added the Bug thing that needs fixing label Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing
Projects
None yet
Development

No branches or pull requests

2 participants