pizza
This file
Path
examples/pizza
27 lines · 869 bytes
Last changed by
Make examples more consistent with "Try the following" (#1629)John Geebefore adoption2cc3a36
History of this fileTake it
The walk stopped after 200 commits: lines older than 2aad525 point at it.
Update dependencies (#1214)John Geebefore adoption2aad525
lines 1–2why, one step back1#!/usr/bin/env node2Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b
lines 3–5why, one step back3// const { Command } = require('commander'); // (normal include)4const { Command } = require('../'); // include commander in git clone of commander repo5const program = new Command();Update dependencies (#1214)John Geebefore adoption2aad525
lines 6–7why, one step back67programChange to safe storage of options by default, and change action parameters (#1409)John Geebefore adoptionf76bc71
line 8why, one step back8 .description('An application for pizza ordering')Update dependencies (#1214)John Geebefore adoption2aad525
lines 9–10why, one step back9 .option('-p, --peppers', 'Add peppers')10 .option('-c, --cheese <type>', 'Add the specified type of cheese', 'marble')Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b
lines 11–12why, one step back11 .option('-C, --no-cheese', 'You do not want any cheese');12Change to safe storage of options by default, and change action parameters (#1409)John Geebefore adoptionf76bc71
line 13why, one step back13program.parse();Update dependencies (#1214)John Geebefore adoption2aad525
line 14why, one step back14Change to safe storage of options by default, and change action parameters (#1409)John Geebefore adoptionf76bc71
line 15why, one step back15const options = program.opts();Update dependencies (#1214)John Geebefore adoption2aad525
line 16why, one step back16console.log('you ordered a pizza with:');Change to safe storage of options by default, and change action parameters (#1409)John Geebefore adoptionf76bc71
lines 17–18why, one step back17if (options.peppers) console.log(' - peppers');18const cheese = !options.cheese ? 'no' : options.cheese;Update dependencies (#1214)John Geebefore adoption2aad525
line 19why, one step back19console.log(' - %s cheese', cheese);Make examples more consistent with "Try the following" (#1629)John Geebefore adoption2cc3a36
lines 20–27why, one step back2021// Try the following on macOS or Linux:22// ./pizza --help 23//24// Try the following:25// ./pizza --help 26// node pizza --peppers --cheese=blue27// node pizza --no-cheese