Comparing version 1.0.5 to 1.0.6
@@ -101,7 +101,11 @@ "use strict"; | ||
CLI.prototype.on = function (commandName, commandFunction) { | ||
if (this.argv._ && this.argv._[0] === commandName){ | ||
if (typeof(commandFunction) !== "function"){ | ||
throw new E("excepted-type-is-function", commandFunction); | ||
if (typeof(commandName) === "function"){ | ||
commandName.bind(this)(); | ||
} else { | ||
if (this.argv._ && this.argv._[0] === commandName){ | ||
if (typeof(commandFunction) !== "function"){ | ||
throw new E("excepted-type-is-function", commandFunction); | ||
} | ||
commandFunction.bind(this)(); | ||
} | ||
commandFunction.bind(this)(); | ||
} | ||
@@ -108,0 +112,0 @@ }; |
{ | ||
"name": "n-cli", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "a usefull toolset for node commandline applications", | ||
@@ -5,0 +5,0 @@ "homepage": "", |
9446
152