Skip to content
Myr

allow "-" hyphen as an option argument with subcommand

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by miyajan · committed by miyajan · parent d9abf56 · Browse files · 2 files+22 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+22 added−1 removed

  • tests:+21 added−0 removed
  • other:+1 added−1 removed

2 files+22 added−1 removed

added:test/test.options.subcommand-hyphen.js+21 added
modified:index.js+1 added-1 removed
735 unmodified lines
736737 // If the next argument looks like it might be738 // an argument for this option, we pass it on.739 // If it isn't, then it'll simply be ignored740 if (argv[i+1] && '-' != argv[i+1][0]) {740 if (argv[i+1] && ('-' != argv[i+1][0] || '-' === argv[i+1])) {741 unknownOptions.push(argv[++i]);742 }743 continue;744 }
402 unmodified lines