Skip to content
Myr

Update example in Readme.md to include camelCase

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

The first example `Readme.md` didn't include an example of how options with dashes are converted to camelCase properties on the `program` variable. This commit changes the `bbq` option in the example to `bbq-sauce` in order to make this clear.

authored by Malthe Jorgensen · committed by Malthe Jorgensen · parent 89ac7f3 · Browse files · 1 file+2 added−2 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+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:Readme.md+2 added-2 removed
29 unmodified lines
30program31 .version('0.0.1')32 .option('-p, --peppers', 'Add peppers')33 .option('-P, --pineapple', 'Add pineapple')34 .option('-b, --bbq', 'Add bbq sauce')34 .option('-b, --bbq-sauce', 'Add bbq sauce')35 .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')36 .parse(process.argv);3738console.log('you ordered a pizza with:');39if (program.peppers) console.log(' - peppers');40if (program.pineapple) console.log(' - pineapple');41if (program.bbq) console.log(' - bbq');41if (program.bbqSauce) console.log(' - bbq');42console.log(' - %s cheese', program.cheese);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.
284 unmodified lines