Permalink
Browse files

Add -v option to quickly see which version you're on.

  • Loading branch information...
1 parent 6634d69 commit bbea7e81545ea420f8c86dcb2368d998a2aa2107 @jacobrask committed Apr 23, 2012
Showing with 7 additions and 2 deletions.
  1. +1 −1 lib/languages.js
  2. +3 −1 lib/main.js
  3. +3 −0 src/main.coffee
View
@@ -53,7 +53,7 @@
preCmd = "" + this.preprocessor.cmd + " " + (this.preprocessor.args.join(' ')) + " " + filename;
}
return exec(preCmd, function(err, stdout, stderr) {
- if ((err != null) || stderr !== '') {
+ if (err != null) {
return cb(new Error("There was an error processing " + filename + ".\n" + (err.message || stderr)));
}
return cb(err, stdout);
View
@@ -25,7 +25,9 @@
gfm: true
});
- options = optimist.usage('Usage: $0 [options] [INPUT]').describe('name', 'Name of the project').alias('n', 'name').demand('name').describe('out', 'Output directory').alias('o', 'out')["default"]('out', 'docs').describe('resources', 'Directory for static resources').alias('s', 'resources')["default"]('resources', path.resolve(__dirname, '../resources')).describe('preprocessor', 'Custom preprocessor command').describe('include', 'CSS to include on all pages').argv;
+ if (optimist.argv.version != null) return console.log("StyleDocco 0.3.5");
+
+ options = optimist.usage('Usage: $0 [options] [INPUT]').describe('name', 'Name of the project').alias('n', 'name').demand('name').describe('out', 'Output directory').alias('o', 'out')["default"]('out', 'docs').describe('resources', 'Directory for static resources').alias('s', 'resources')["default"]('resources', path.resolve(__dirname, '../resources')).describe('preprocessor', 'Custom preprocessor command').describe('include', 'CSS to include on all pages').describe('version', 'Display StyleDocco version').argv;
options["in"] = options._[0] || './';
View
@@ -11,6 +11,8 @@ _ = require './utils'
marked.setOptions gfm: on
+if optimist.argv.version? then return console.log "StyleDocco 0.3.5"
+
options = optimist
.usage('Usage: $0 [options] [INPUT]')
.describe('name', 'Name of the project').alias('n', 'name').demand('name')
@@ -19,6 +21,7 @@ options = optimist
.default('resources', path.resolve(__dirname, '../resources'))
.describe('preprocessor', 'Custom preprocessor command')
.describe('include', 'CSS to include on all pages')
+ .describe('version', 'Display StyleDocco version')
.argv
options.in = options._[0] or './'

0 comments on commit bbea7e8

Please sign in to comment.