Commit cf8a36e4 authored by Iuri Matias's avatar Iuri Matias

add version & help options

parent b36c6f02
...@@ -20,10 +20,20 @@ function mapVerbosity (v) { ...@@ -20,10 +20,20 @@ function mapVerbosity (v) {
} }
return levels[v] return levels[v]
} }
const version = require('../package.json').version
commander.version(version)
commander.command('version').description('output the version number').action(function () {
console.log(version)
})
commander.command('help').description('output usage information').action(function () {
commander.help()
})
// get current version // get current version
const pjson = require('../package.json')
commander commander
.version(pjson.version)
.option('-v, --verbose <level>', 'run with verbosity', mapVerbosity) .option('-v, --verbose <level>', 'run with verbosity', mapVerbosity)
.action(function (filename) { .action(function (filename) {
// Console message // Console message
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment