Skip to content

Commit

Permalink
Add a --version option
Browse files Browse the repository at this point in the history
This closes #11
  • Loading branch information
demsking committed Feb 10, 2018
1 parent 292f4ba commit 79e97a3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ const parseArgs = (argv, requireFiles) => {
const arg = argv[i]

switch (arg) {
case '--version':
const { name, version, license, author } = require('../package')
const output = `${name} (${license}) ${version}\nMade with <3 by ${author}\n`

process.stderr.write(output)
process.exit()

case '--level':
if (!argv[i + 1]) {
throw new Error('Missing level value. Usage: --level [integer]\n')
Expand Down

0 comments on commit 79e97a3

Please sign in to comment.