Lines Matching refs:option

16     - [Common option types, boolean and value](#common-option-types-boolean-and-value)
17 - [Default option value](#default-option-value)
18 …- [Other option types, negatable boolean and flag|value](#other-option-types-negatable-boolean-and…
19 - [Custom option processing](#custom-option-processing)
20 - [Required option](#required-option)
21 - [Version option](#version-option)
37 - [Avoiding option name clashes](#avoiding-option-name-clashes)
74 Options are defined with the `.option()` method, also serving as documentation for the options. Eac…
76 …ngine` etc. See also optional new behaviour to [avoid name clashes](#avoiding-option-name-clashes).
87 ### Common option types, boolean and value
89 The two most used option types are a boolean flag, and an option which takes a value (declared usin…
95 .option('-d, --debug', 'output extra debugging')
96 .option('-s, --small', 'small pizza size')
97 .option('-p, --pizza-type <type>', 'flavour of pizza');
112 error: option '-p, --pizza-type <type>' argument missing
125 ### Default option value
127 You can specify a default value for an option which takes a value.
133 .option('-c, --cheese <type>', 'add the specified type of cheese', 'blue');
147 ### Other option types, negatable boolean and flag|value
149 You can specify a boolean option long name with a leading `no-` to set the option value to false wh…
150 Defined alone this also makes the option true by default.
159 .option('--no-sauce', 'Remove sauce')
160 .option('--cheese <flavour>', 'cheese flavour', 'mozzarella')
161 .option('--no-cheese', 'plain with no cheese')
173 error: unknown option '--sauce'
180 You can specify an option which functions as a flag but may also take a value (declared using squar…
186 .option('-c, --cheese [type]', 'Add cheese with optional type');
204 ### Custom option processing
206 You may specify a function to do custom processing of option values. The callback function receives…
207 previous value for the option. It returns the new value for the option.
209 This allows you to coerce the option value to the desired type, or accumulate values, or do entirel…
211 You can optionally specify the default/starting value for the option after the function.
234 .option('-f, --float <number>', 'float argument', parseFloat)
235 .option('-i, --integer <number>', 'integer argument', myParseInt)
236 .option('-v, --verbose', 'verbosity that can be increased', increaseVerbosity, 0)
237 .option('-c, --collect <value>', 'repeatable value', collect, [])
238 .option('-l, --list <items>', 'comma separated list', commaSeparatedList)
263 ### Required option
265option using `.requiredOption`. The option must have a value after parsing, usually specified on t…
278 error: required option '-c, --cheese <type>' not specified
281 ### Version option
283 The optional `version` method adds handling for displaying the command version. The default option
295 the same syntax for flags as the `option` method. The version flags can be named anything, but a lo…
394 .option('-r, --recursive', 'Remove recursively')
421 You can specify a custom name with the `executableFile` configuration option.
443 help option is `-h,--help`. ([example](./examples/pizza))
476 .option('-f, --foo', 'enable some foo');
551 You can execute custom actions by listening to command and option events.
554 program.on('option:verbose', function () {
572 If the arguments follow different conventions than node you can pass a `from` option in the second …
586 ### Avoiding option name clashes
588 The original and default behaviour is that the option values are stored
596 - `storeOptionsAsProperties`: whether to store option values as properties on command object, or st…
609 .option('-n,--name <name>');
613 .option('-a,--action <action>')
649 You can enable `--harmony` option in two ways:
652 - Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The …
688 .option('-C, --chdir <path>', 'change the working directory')
689 .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
690 .option('-T, --no-tests', 'ignore test hook');
695 .option("-s, --setup_mode [mode]", "Which setup mode to use")
706 .option("-e, --exec_mode <mode>", "Which exec mode to use")