Skip to content

Commit 12c2926

Browse files
committed
chore: use default params
1 parent 885d9ad commit 12c2926

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Sade {
1717
this.curr = ''; // reset
1818
}
1919

20-
command(str, desc, opts) {
20+
command(str, desc, opts={}) {
2121
let cmd=[], usage=[], rgx=/(\[|<)/;
2222
// All non-([|<) are commands
2323
str.split(/\s+/).forEach(x => {
@@ -32,7 +32,7 @@ class Sade {
3232
}
3333

3434
this.curr = cmd;
35-
(opts && opts.default) && (this.default=cmd);
35+
if (opts.default) this.default=cmd;
3636

3737
!~cmd.indexOf('__') && usage.unshift(cmd); // re-include `cmd`
3838
usage = usage.join(' '); // to string

0 commit comments

Comments
 (0)