Skip to content
Myr

pm

This file

Path

examples/pm

28 lines · 932 bytes

Last changed by

Fix help section order and padding (#652)Valentin Trinquébefore adoption14e5738

History of this file

Take it

1#!/usr/bin/env node23var program = require('..');45program6  .version('0.0.1')7  .description('Fake package manager')8  .command('install [name]', 'install one or more packages').alias('i')9  .command('search [query]', 'search with optional query').alias('s')10  .command('list', 'list packages installed')11  .command('publish', 'publish the package').alias('p')12  .parse(process.argv);1314// here .command() is invoked with a description,15// and no .action(callback) calls to handle sub-commands.16// this tells commander that you're going to use separate17// executables for sub-commands, much like git(1) and other18// popular tools.1920// here only ./pm-install(1) is implemented, however you21// would define ./pm-search(1) and ./pm-list(1) etc.2223// Try the following:24//   ./examples/pm25//   ./examples/pm help install26//   ./examples/pm install -h27//   ./examples/pm install foo bar baz28//   ./examples/pm install foo bar baz --force