1const { Command } = require('commander')
2const program = new Command()
3
4program
5 .option('-d, --debug', 'output extra debugging')
6 .option('-s, --small', 'small pizza size')
7 .option('-p, --pizza-type <type>', 'flavour of pizza', 'peperoni') // default
8 .parse(process.argv)
9
10if (program.debug)
11 console.log(program.opts())
12console.log('pizza details:')
13if (program.small)
14 console.log('- small pizza size')
15if (program.pizzaType)
16 console.log(`- ${program.pizzaType}`);