Skip to content
Myr

pm

This file

Path

examples/pm

27 lines · 860 bytes

Last changed by

Merge pull request #391 from zhiyelee/newversionZhiye Libefore adoption4dae21d

History of this file

Take it

1#!/usr/bin/env node23var program = require('..');45program6  .version('0.0.1')7  .command('install [name]', 'install one or more packages')8  .command('search [query]', 'search with optional query')9  .command('list', 'list packages installed')10  .command('publish', 'publish the package')11  .parse(process.argv);1213// here .command() is invoked with a description,14// and no .action(callback) calls to handle sub-commands.15// this tells commander that you're going to use separate16// executables for sub-commands, much like git(1) and other17// popular tools.1819// here only ./pm-install(1) is implemented, however you20// would define ./pm-search(1) and ./pm-list(1) etc.2122// Try the following:23//   ./examples/pm24//   ./examples/pm help install25//   ./examples/pm install -h26//   ./examples/pm install foo bar baz27//   ./examples/pm install foo bar baz --force