Comparing version 1.5.0 to 1.5.1
@@ -20,3 +20,3 @@ const mri = require('mri'); | ||
command(str, desc, opts) { | ||
command(str, desc, opts={}) { | ||
let cmd=[], usage=[], rgx=/(\[|<)/; | ||
@@ -36,3 +36,3 @@ // All non-([|<) are commands | ||
this.curr = cmd; | ||
(opts && opts.default) && (this.default=cmd); | ||
if (opts.default) this.default=cmd; | ||
@@ -43,3 +43,3 @@ !~cmd.indexOf('__') && usage.unshift(cmd); // re-include `cmd` | ||
this.tree[cmd] = { usage, options:[], alias:{}, default:{}, examples:[] }; | ||
desc && this.describe(desc); | ||
if (desc) this.describe(desc); | ||
@@ -118,4 +118,4 @@ return this; | ||
offset++; | ||
} else if (name) { | ||
return $.error(bin, `Invalid command: ${name}`); | ||
} else if (tmp) { | ||
return $.error(bin, `Invalid command: ${tmp}`); | ||
} //=> else: cmd not specified, wait for now... | ||
@@ -122,0 +122,0 @@ } |
{ | ||
"name": "sade", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Smooth (CLI) operator 🎶", | ||
@@ -5,0 +5,0 @@ "repository": "lukeed/sade", |
21291