Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Techniv committed Dec 6, 2013
1 parent 97f5eee commit 95e9fc4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
11 changes: 5 additions & 6 deletions libs/cmd-conf.js
Expand Up @@ -87,9 +87,8 @@ function cmdConf(cmd){

for(var name in config){
var item = config[name];
item.name = name;

processConfItem(item);
processConfItem(name, item);
}

conf.configured = true;
Expand All @@ -107,7 +106,7 @@ function cmdConf(cmd){
return parameters;
};

function processConfItem(item){
function processConfItem(name, item){

if(typeof item.action == 'string' && typeof item.key == 'string'){

Expand All @@ -129,13 +128,13 @@ function cmdConf(cmd){
return false;
break;
}

item.name = name;
conf.key[item.key] = item;
if(item.shortKey) conf.shortKey[item.shortKey] = item;

if(item.defaultValue !== undefined) setParam(item.name, item.defaultValue);
if(item.defaultValue !== undefined) setParam(name, item.defaultValue);
} else {
setParam(item.name, item);
setParam(name, item);
}
return true;
}
Expand Down
5 changes: 3 additions & 2 deletions package.json
@@ -1,11 +1,12 @@
{
"name": "cmd-conf",
"description": "A command line analyser for Node.JS",
"version": "0.4.0-dev",
"version": "0.4.0-dev2",
"author": "Vincent Peybernes [Techniv] <vpeybernes.pro@gmail.com>",
"url": "https://github.com/Techniv/node-cmd-conf",
"repository": {"type": "git", "url": "https://github.com/Techniv/node-cmd-conf.git"},

"main": "libs/main.js",
"main": "libs/cmd-conf.js",
"engines": { "node": ">= 0.8.x" }

}

0 comments on commit 95e9fc4

Please sign in to comment.