Permalink
Browse files

Support abbreviated cdn commands

  • Loading branch information...
davglass committed Dec 19, 2012
1 parent 3f74516 commit e1840afa18be88aceae514c86c2b600de66ad553
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/cmds/cdn.js
View
@@ -273,6 +273,7 @@ mods = {
});
},
init: function(options) {
+ var i, found = [];
this.options = options;
this.cmd = options.parsed.argv.remain[0];
if (this.cmd === 'pending') {
@@ -297,6 +298,16 @@ mods = {
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]) {
this.print();
return;

0 comments on commit e1840af

Please sign in to comment.