From a6825ccf2ed6360d1240e540ed87e988eb03ffca Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Sat, 25 Jun 2016 17:37:07 +0200 Subject: [PATCH 1/2] Added -v switch. --- autocannon.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/autocannon.js b/autocannon.js index fe20bdee..19d2e782 100755 --- a/autocannon.js +++ b/autocannon.js @@ -26,6 +26,7 @@ function start () { body: 'b', bailout: 'B', input: 'i', + version: 'v', help: 'h' }, default: { @@ -39,6 +40,12 @@ function start () { argv.url = argv._[0] + if (argv.version) { + console.log('autocannon', 'v' + require('./package').version) + console.log('node', process.version) + return + } + if (!argv.url || argv.help) { console.error(help) return From 9ba0567a01be8733e3a0a44bddc78f4111e601f0 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Sun, 26 Jun 2016 09:39:38 +0200 Subject: [PATCH 2/2] Documented -v switch --- README.md | 1 + help.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 64bd175c..2d6f6e11 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ Available options: -B/--bailout NUM The number of failures before initiating a bailout -j/--json Print the output as json -l/--latency Print all the latency data + -v/--version Print the version number -h/--help Print this menu ``` diff --git a/help.txt b/help.txt index 10f49473..48c47485 100644 --- a/help.txt +++ b/help.txt @@ -12,4 +12,5 @@ Available options: -B/--bailout NUM The number of failures before initiating a bailout -j/--json Print the output as json -l/--latency Print all the latency data + -v/--version Print the version number -h/--help Print this menu