Skip to content

Commit 896a036

Browse files
committed
bin/gapps: Print usage on argument error.
1 parent 2bf9c00 commit 896a036

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

bin/gapps

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,6 @@ if (program.args.length == 0) {
6060
if (err) {
6161
var p = require('process')
6262
console.log(err)
63+
program.outputHelp()
6364
p.exit(2)
6465
}

t/t010-basic-cli.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ tlib.test('help', (t) => {
2727
tlib.test('no command fails', (t) => {
2828
const cmd = tlib.spawn(t, './bin/gapps')
2929
cmd.stdout.match('No command specified\n')
30+
cmd.stdout.match(/Usage:/)
3031
if (tape_spawn_fixed)
3132
cmd.fails()
3233
cmd.end()
@@ -35,6 +36,7 @@ tlib.test('no command fails', (t) => {
3536
tlib.test('bad commands fail', (t) => {
3637
const cmd = tlib.spawn(t, './bin/gapps rubbish')
3738
cmd.stdout.match('Bad command specified\n')
39+
cmd.stdout.match(/Usage:/)
3840
if (tape_spawn_fixed)
3941
cmd.fails()
4042
cmd.end()

0 commit comments

Comments
 (0)