Permalink
Browse files

'hidden' to hide option from usage

  • Loading branch information...
1 parent 66979fc commit c7dfc58a9b6554a23db322f8c90b455c609d6c48 @harthur committed Jun 4, 2011
Showing with 6 additions and 1 deletion.
  1. +4 −0 README.md
  2. +2 −1 nomnom.js
View
@@ -167,6 +167,10 @@ If the option has a `position` and `list` is `true`, all positional args includi
If this is set to `true` and the option isn't in the args, a message will be printed and the program will exit.
+#### hidden
+
+Option won't be printed in the usage
+
# Parser interface
`require("nomnom")` will give you the option parser. You can also make an instance of a parser with `require("nomnom")()`. You can chain any of these functions off of a parser:
View
@@ -266,7 +266,8 @@ function ArgParser() {
str += "options:\n"
options.forEach(function(opt) {
- str += opt.string + "\t\t" + (opt.help || "") + "\n";
+ if(!opt.hidden)
+ str += opt.string + "\t\t" + (opt.help || "") + "\n";
});
return str + "\n" + (parser.helpString || "") + "\n";
}

0 comments on commit c7dfc58

Please sign in to comment.