Skip to content

Commit

Permalink
Merge pull request #25 from mcollina/version
Browse files Browse the repository at this point in the history
Added -v switch.
  • Loading branch information
mcollina authored Jun 26, 2016
2 parents e4f8690 + 9ba0567 commit c692531
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
7 changes: 7 additions & 0 deletions autocannon.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function start () {
body: 'b',
bailout: 'B',
input: 'i',
version: 'v',
help: 'h'
},
default: {
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c692531

Please sign in to comment.