nomnom
nomnom copied to clipboard
using `default: true` together with `flag: true` effectively disables the option and always produces TRUE.
nomnom does not cope well with 'flag' options which are set to true by default: there's no way to set these to false instead.
Example option:
var opts = require('nomnom')
.options({
debug: {
abbr: 't',
flag: true,
default: true, // <-- !!! you **always** get opts.debug === true now
help: 'Debug mode'
},
//...
}).parse();
In other words: there's no -t- (note trailing minus) or similar way to say on the commandline: set flag option to FALSE (rather than TRUE).
Other systems sometimes support -\<flag_option>+ and -\<flag_option>- i.e. trailing + or - to force a TRUE or FALSE value for flag options.
Notes: the long-name phrasing of an option, e.g. --debug, already has this ability by prefixing it with no-: --no-debug.