pm
This file
Path
examples/pm
33 lines · 1.1 KiB
Last changed by
Merge pull request #1683 from tj/release/9.xJohn Geebefore adoption02a124c
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
line 6why, one step back6Make examples more consistent with "Try the following" (#1629)John Geebefore adoption2cc3a36
lines 7–13why, one step back7// Example of subcommands which are implemented as stand-alone executable files.8//9// When `.command()` is invoked with a description argument,10// this tells Commander that you're going to use a stand-alone executable for the subcommand.11//12// Only `install` and `list` are implemented, see pm-install and pm-list.js13Update dependencies (#1214)John Geebefore adoption2aad525
line 14why, one step back14programMerge pull request #1683 from tj/release/9.xJohn Geebefore adoption02a124c
line 15why, one step back15 .name('pm')Update dependencies (#1214)John Geebefore adoption2aad525
lines 16–19why, one step back16 .version('0.0.1')17 .description('Fake package manager')18 .command('install [name]', 'install one or more packages').alias('i')19 .command('search [query]', 'search with optional query').alias('s')Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b
lines 20–21why, one step back20 .command('update', 'update installed packages', { executableFile: 'myUpdateSubCommand' })21 .command('list', 'list packages installed', { isDefault: true });Update dependencies (#1214)John Geebefore adoption2aad525
line 22why, one step back22Merge pull request #1305 from tj/release/6.xTomoaki Abebefore adoptionc5a5e7b
lines 23–24why, one step back23program.parse(process.argv);24Make examples more consistent with "Try the following" (#1629)John Geebefore adoption2cc3a36
lines 25–27why, one step back25// Try the following on macOS or Linux:26// ./examples/pm27//Update dependencies (#1214)John Geebefore adoption2aad525
line 28why, one step back28// Try the following:Make examples more consistent with "Try the following" (#1629)John Geebefore adoption2cc3a36
lines 29–33why, one step back29// node pm30// node pm help install31// node pm install -h32// node pm install foo bar baz33// node pm install foo bar baz --force