Skip to content
Myr

Documentation updated for options with --no prefix

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by deepakpathania · committed by Roman Vanesyan · parent 0ae8353 · Browse files · 1 file+19 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+19 added−0 removed

  • other:+19 added−0 removed

1 file+19 added−0 removed

modified:Readme.md+19 added
42 unmodified lines
43```4445 Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc.4647Note that multi-word options starting with `--no` prefix negate the boolean value of the following word. For example, `--no-sauce` sets the value of `program.sauce` to false. 4849```js50#!/usr/bin/env node5152/**53 * Module dependencies.54 */5556var program = require('commander');5758program59 .option('--no-sauce', 'Remove sauce')60 .parse(process.argv);6162console.log('you ordered a pizza');63if (program.sauce) console.log(' with sauce');64else console.log(' without sauce');65```6667## Coercion6869```js70function range(val) {
300 unmodified lines