Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: 75lb/command-line-args
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.1.0
Choose a base ref
...
head repository: 75lb/command-line-args
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.1.1
Choose a head ref
  • 7 commits
  • 9 files changed
  • 2 contributors

Commits on Mar 27, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e88e500 View commit details
  2. Copy the full SHA
    3da987f View commit details
  3. Merge pull request #100 from zawataki/master

    Make git ignore node_modules directory
    75lb authored Mar 27, 2019
    Copy the full SHA
    f87d7ba View commit details

Commits on Mar 30, 2019

  1. Merge branch 'parse-correctly-when-eval-option' of https://github.com…

    …/zawataki/command-line-args into zawataki-parse-correctly-when-eval-option
    75lb committed Mar 30, 2019
    Copy the full SHA
    62cca98 View commit details

Commits on Mar 31, 2019

  1. Copy the full SHA
    b9860f4 View commit details
  2. Copy the full SHA
    e28c9b0 View commit details
  3. 5.1.1

    75lb committed Mar 31, 2019
    Copy the full SHA
    b07cb35 View commit details
Showing with 197 additions and 234 deletions.
  1. +1 −0 .gitignore
  2. +6 −1 dist/index.js
  3. +6 −1 dist/index.mjs
  4. +120 −101 dist/tests.js
  5. +6 −1 lib/argv-tools.mjs
  6. +35 −126 package-lock.json
  7. +5 −4 package.json
  8. +17 −0 test/detect-process-execArgv.mjs
  9. +1 −0 test/tests.mjs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
tmp
.coveralls.yml
coverage
node_modules/
7 changes: 6 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
@@ -211,7 +211,8 @@ class ArgvArray extends Array {
} else {
/* if no argv supplied, assume we are parsing process.argv */
argv = process.argv.slice(0);
argv.splice(0, 2);
const deleteCount = process.execArgv.some(isExecArg) ? 1 : 2;
argv.splice(0, deleteCount);
}
argv.forEach(arg => this.push(String(arg)));
}
@@ -330,6 +331,10 @@ function isValue (arg) {
return !(isOption(arg) || re.combinedShort.test(arg) || re.optEquals.test(arg))
}

function isExecArg (arg) {
return ['--eval', '-e'].indexOf(arg) > -1 || arg.startsWith('--eval=')
}

/**
* For type-checking Javascript values.
* @module typical
7 changes: 6 additions & 1 deletion dist/index.mjs
Original file line number Diff line number Diff line change
@@ -207,7 +207,8 @@ class ArgvArray extends Array {
} else {
/* if no argv supplied, assume we are parsing process.argv */
argv = process.argv.slice(0);
argv.splice(0, 2);
const deleteCount = process.execArgv.some(isExecArg) ? 1 : 2;
argv.splice(0, deleteCount);
}
argv.forEach(arg => this.push(String(arg)));
}
@@ -326,6 +327,10 @@ function isValue (arg) {
return !(isOption(arg) || re.combinedShort.test(arg) || re.optEquals.test(arg))
}

function isExecArg (arg) {
return ['--eval', '-e'].indexOf(arg) > -1 || arg.startsWith('--eval=')
}

/**
* For type-checking Javascript values.
* @module typical
Loading