split.js
This file
Path
examples/split.js
16 lines · 479 bytes · JavaScript
Last changed by
Merge from develop (#2482)John Geebefore adoptionb51c0ea
History of this fileTake it
The walk stopped after 200 commits: lines older than 3103c6b point at it.
Use standard import in examples (#2168)John Geebefore adoption41b12cf
line 1why, one step back1const { program } = require('commander');Add more tests for implies (#1730)John Geebefore adoption3103c6b
lines 2–4why, one step back23// This is used as an example in the README for the Quick Start.4Update README and examples for allowExcessArguments change (#2266)John Geebefore adoption2c9051a
line 5why, one step back5program.option('--first').option('-s, --separator <char>').argument('<string>');Add more tests for implies (#1730)John Geebefore adoption3103c6b
lines 6–13why, one step back67program.parse();89const options = program.opts();10const limit = options.first ? 1 : undefined;11console.log(program.args[0].split(options.separator, limit));1213// Try the following:Merge from develop (#2482)John Geebefore adoptionb51c0ea
lines 14–15why, one step back14// node split -s - --fits a-b-c15// node split -s - --first a-b-cAdd more tests for implies (#1730)John Geebefore adoption3103c6b
line 16why, one step back16// node split --separator=, a,b,c