Skip to content

Commit

Permalink
feat: add '--version' CLI option
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous committed Sep 20, 2017
1 parent a244245 commit c87e0f1
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 7 deletions.
104 changes: 101 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"markdownlint-cli": "^0.3.1",
"npm-run-all": "^4.1.1",
"standard-version": "^4.2.0",
"yargs": "^8.0.2"
"yargs": "^9.0.1"
},
"devDependencies": {
"@std/esm": "^0.8.2",
Expand Down
1 change: 0 additions & 1 deletion src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ module.exports = function cli() {
handler: () => init(),
})
.demandCommand(1)
.help()
.argv
}
5 changes: 3 additions & 2 deletions test/help.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Commands:
init Setup npm project
Options:
--help Show help [boolean]
--help Show help [boolean]
--version Show version number [boolean]
`.trim()

suite('help', () => {
Expand All @@ -19,7 +20,7 @@ suite('help', () => {
assert(error instanceof Error)
assert(code === 1)
assert(stdout === '')
assert(stderr.includes(HELP))
assert(stderr.includes(HELP), stderr)
})

test('with `--help` option', async () => {
Expand Down

0 comments on commit c87e0f1

Please sign in to comment.