We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 885d9ad commit 12c2926Copy full SHA for 12c2926
lib/index.js
@@ -17,7 +17,7 @@ class Sade {
17
this.curr = ''; // reset
18
}
19
20
- command(str, desc, opts) {
+ command(str, desc, opts={}) {
21
let cmd=[], usage=[], rgx=/(\[|<)/;
22
// All non-([|<) are commands
23
str.split(/\s+/).forEach(x => {
@@ -32,7 +32,7 @@ class Sade {
32
33
34
this.curr = cmd;
35
- (opts && opts.default) && (this.default=cmd);
+ if (opts.default) this.default=cmd;
36
37
!~cmd.indexOf('__') && usage.unshift(cmd); // re-include `cmd`
38
usage = usage.join(' '); // to string
0 commit comments