Skip to content

Commit

Permalink
Add version option
Browse files Browse the repository at this point in the history
  • Loading branch information
Casper Beyer authored and zertosh committed Apr 26, 2015
1 parent fe724a4 commit f667e99
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bin/cmd.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node

var fs = require('fs');
var path = require('path');
var outpipe = require('outpipe');

var fromArgs = require('./args.js');
Expand All @@ -9,6 +10,16 @@ var w = fromArgs(process.argv.slice(2));
var outfile = w.argv.o || w.argv.outfile;
var verbose = w.argv.v || w.argv.verbose;

if (w.argv.version) {
console.error('watchify v' + require('../package.json').version +
' (in ' + path.resolve(__dirname, '..') + ')'
);
console.error('browserify v' + require('browserify/package.json').version +
' (in ' + path.dirname(require.resolve('browserify')) + ')'
);
return;
}

if (!outfile) {
console.error('You MUST specify an outfile with -o.');
process.exit(1);
Expand Down
4 changes: 4 additions & 0 deletions readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ Standard Options:
Show when a file was written and how long the bundling took (in
seconds).
--version
Show the watchify and browserify versions with their module paths.
```

```
Expand Down

0 comments on commit f667e99

Please sign in to comment.