Skip to content

Commit

Permalink
Support abbreviated cdn commands
Browse files Browse the repository at this point in the history
  • Loading branch information
davglass committed Dec 19, 2012
1 parent 3f74516 commit e1840af
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/cmds/cdn.js
Expand Up @@ -273,6 +273,7 @@ mods = {
}); });
}, },
init: function(options) { init: function(options) {
var i, found = [];
this.options = options; this.options = options;
this.cmd = options.parsed.argv.remain[0]; this.cmd = options.parsed.argv.remain[0];
if (this.cmd === 'pending') { if (this.cmd === 'pending') {
Expand All @@ -297,6 +298,16 @@ mods = {
log.bail('command is not valid in yui repo: yogi help cdn'); log.bail('command is not valid in yui repo: yogi help cdn');
} }
} }
if (this.cmd && !this.cmds[this.cmd]) {
for (i in this.cmds) {
if (i.indexOf(this.cmd) === 0) {
found.push(i);
}
}
if (found.length === 1) {
this.cmd = found.pop();
}
}
if (!this.cmd || !this.cmds[this.cmd]) { if (!this.cmd || !this.cmds[this.cmd]) {
this.print(); this.print();
return; return;
Expand Down

0 comments on commit e1840af

Please sign in to comment.