summaryrefslogtreecommitdiff
path: root/benchmark/_cli.js
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2017-01-16 02:59:13 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2017-01-31 03:03:57 +0800
commit60d77bd514d3dc65cfbb64ebb8ae1f364e8bf8eb (patch)
tree7090c026e7b5cdb9550d18be604e2d375a318800 /benchmark/_cli.js
parentca3d131bd42afa0c68be6aeb27623d53eae547a1 (diff)
downloadandroid-node-v8-60d77bd514d3dc65cfbb64ebb8ae1f364e8bf8eb.tar.gz
android-node-v8-60d77bd514d3dc65cfbb64ebb8ae1f364e8bf8eb.tar.bz2
android-node-v8-60d77bd514d3dc65cfbb64ebb8ae1f364e8bf8eb.zip
benchmark: add progress indicator to compare.js
* Print the progress bar and the current benchmark to stderr when stderr is TTY and stdout is not. * Allow cli arguments without values via setting.boolArgs * Add --no-progress option PR-URL: https://github.com/nodejs/node/pull/10823 Fixes: https://github.com/nodejs/node/issues/8659 Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Diffstat (limited to 'benchmark/_cli.js')
-rw-r--r--benchmark/_cli.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/benchmark/_cli.js b/benchmark/_cli.js
index be2f7ffff8..17718c4c4d 100644
--- a/benchmark/_cli.js
+++ b/benchmark/_cli.js
@@ -45,13 +45,13 @@ function CLI(usage, settings) {
currentOptional = arg.slice(1);
}
- // Default the value to true
- if (!settings.arrayArgs.includes(currentOptional)) {
+ if (settings.boolArgs && settings.boolArgs.includes(currentOptional)) {
this.optional[currentOptional] = true;
+ mode = 'both';
+ } else {
+ // expect the next value to be option related (either -- or the value)
+ mode = 'option';
}
-
- // expect the next value to be option related (either -- or the value)
- mode = 'option';
} else if (mode === 'option') {
// Optional arguments value