Skip to content

Commit cf17c08

Browse files
committed
Show help on command fails
1 parent b67bd99 commit cf17c08

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

eask

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,14 @@ const yargs = require("yargs");
55
yargs
66
.usage("eask <command> [args]")
77
.commandDir("cmds")
8+
.showHelpOnFail(true)
9+
.help(
10+
'help',
11+
'Show usage instructions.'
12+
)
13+
.command({
14+
command: '*',
15+
handler() { yargs.showHelp(); console.log('\n'); }
16+
})
817
.demandCommand()
918
.help().argv;

0 commit comments

Comments
 (0)