Skip to content

Commit 2491a87

Browse files
committed
fix error when necessary options are missing
1 parent 3b71672 commit 2491a87

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bin/nodeppt

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ program
1818
.action(function (filename, options) {
1919
if(typeof filename === 'object'){
2020
console.log('ERROR: please input filename!'.bold.red);
21-
this.commands[0].outputHelp()
21+
this.outputHelp();
2222
return;
2323
}
2424

@@ -72,7 +72,7 @@ program
7272
.option('-H, --host [host]', 'set host address', ipv4 || '0.0.0.0')
7373
.action(function (cmd){
7474
if(typeof cmd !== 'object'){
75-
this.commands[2].outputHelp()
75+
this.outputHelp();
7676
return;
7777
}
7878

@@ -96,7 +96,7 @@ program
9696
.action(function (http_url, save_path) {
9797
if(typeof http_url !== 'string' || typeof save_path !== 'string'){
9898
console.log('ERROR: pdf need a URL'.bold.red);
99-
this.commands[3].outputHelp()
99+
this.outputHelp();
100100
return;
101101
}
102102

0 commit comments

Comments
 (0)