Skip to content
Myr

Merge pull request #365 from zhiyelee/subcommand

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

update README close #364

authored by Zhiye Li · committed by Zhiye Li · parents 5a15a34, ef0a54f · Browse files · 2 files+26 added−22 removed
This commit

State

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

Diff stats

2 files+26 added−22 removed

  • other:+26 added−22 removed

2 files+26 added−22 removed

added:LICENSE+22 added
1(The MIT License)23Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>45Permission is hereby granted, free of charge, to any person obtaining6a copy of this software and associated documentation files (the7'Software'), to deal in the Software without restriction, including8without limitation the rights to use, copy, modify, merge, publish,9distribute, sublicense, and/or sell copies of the Software, and to10permit persons to whom the Software is furnished to do so, subject to11the following conditions:1213The above copyright notice and this permission notice shall be14included in all copies or substantial portions of the Software.1516THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,17EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF18MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.19IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY20CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,21TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE22SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
modified:Readme.md+4 added-22 removed
145 unmodified lines
146 .parse(process.argv);147```148149When `.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. 150The commander will try to find the executable script in __current directory__ with the name `scriptBasename-subcommand`, like `pm-install`, `pm-search`.150The commander will try to search the executables in the directory of the entry script(like `./examples/pm`) with the name `program-command`, like `pm-install`, `pm-search`.151152If the program is designed to installed globally, make sure the executables have proper modes, like `755`.153154## Automated --help155156 The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:157
148 unmodified lines
306You can see more Demos in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory.307308## License309308(The MIT License)310MIT311310Copyright (c) 2011 TJ Holowaychuk &lt;tj@vision-media.ca&gt;311312Permission is hereby granted, free of charge, to any person obtaining313a copy of this software and associated documentation files (the314'Software'), to deal in the Software without restriction, including315without limitation the rights to use, copy, modify, merge, publish,316distribute, sublicense, and/or sell copies of the Software, and to317permit persons to whom the Software is furnished to do so, subject to318the following conditions:319320The above copyright notice and this permission notice shall be321included in all copies or substantial portions of the Software.322323THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,324EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF325MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.326IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY327CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,328TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE329SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.