Skip to content

Instantly share code, notes, and snippets.

@derveloper
Created December 11, 2011 16:51
Show Gist options
  • Save derveloper/1461513 to your computer and use it in GitHub Desktop.
Save derveloper/1461513 to your computer and use it in GitHub Desktop.
(function (global) {
var CommandList = (function () {
return {
test:function (term) {
term.echo("foo");
},
help:function (term,args) {
term.echo("help " + args.join(" "));
},
jan: function(term,args) {
if(args[0] === "mag") {
term.echo("desmopan");
} else CommandList["unknown"](term,"jan",args)
},
unknown:function (term,cmd, args) {
term.echo('unknown command: ' + cmd + " " + args.join(" "));
}
};
})();
// Other things might happen here
// expose our module to the global object
global.CommandList = CommandList;
})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment