Skip to content
Myr

update code highlight

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by zhiyelee · committed by zhiyelee · parent 5204e0f · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:Readme.md+2 added-2 removed
72 unmodified lines
73 to your action as demonstrated above.7475## Git-style sub-commands7677```77```js78// file: ./examples/pm79var program = require('..');8081program
3 unmodified lines
85 .command('list', 'list packages installed')86 .parse(process.argv);87```8889Here `.command()` is invoked with a description, and no `.action(callback)` calls to handle sub-commands. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools.89When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools. 90The commander will try to find the executable script in __current directory__ with the name `scriptBasename-subcommand`, like `pm-install`, `pm-search`.9192## Automated --help93
162 unmodified lines