Skip to content

Commit

Permalink
Add some doc
Browse files Browse the repository at this point in the history
  • Loading branch information
VPeybernes committed Dec 1, 2015
1 parent a352e9a commit ecefaf9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOGS.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
## 1.2.0
- Add '''forceString''' boolean option to force keep the string value (not parse int/float).
- Add some doc.

## 1.1.0
- Add static configuration items.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ server.js
defaultValue: 85 // If the parameter not given, use the default value;
},

verbose:{
verbose:{ // If key is not define, the name is used instead
shortKey: 'v',
action: 'set', // Set a static value
value: true // The value to set
Expand All @@ -39,6 +39,14 @@ server.js
},

staticString: 'foo bar'

serial:{
shortKey: 's',
action: 'get',
number: 1
forceString: true // Disable the parser to force a string value instead of an integer.
defaultValue: "00561"
}
});

var params = cmdConf.getParameters();
Expand All @@ -48,7 +56,11 @@ server.js
```

If you give a simple string to the `configure()` method, witch represent the path of
a JSON file, cmd-conf try to resolve path and load config from this file.
a JSON file, cmd-conf try to resolve path and load config from this file. If you not
pass argument, cmd-conf try to get the configuration to the `config.json` file.

If you call `getParameters()` before `configure()`, the configuration method wil be
automatically fired.


-----------------------------------------------------------------
Expand Down

0 comments on commit ecefaf9

Please sign in to comment.