Replace git-style wording from README (#1171)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
* Remove git-style from docs * Remove stale comment
authored by John Gee · committed by GitHub · parent a094ef2 · Browse files · 2 files·+9 added−9 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+9 added−9 removed
- tests:+1 added−1 removed
- other:+8 added−8 removed
Provenance
- Commit
fbdd132- Tree
9787d0b- Author
John Gee <john@ruru.gen.nz>- Committer
GitHub <noreply@github.com>- Parent
a094ef2
2 files changed+9 added−9 removed
modified:tests/command.asterisk.test.js+1 added-1 removed
4 unmodified lines56789910111213105 unmodified linesExpand all4 unmodified lines// so most uses are probably old code. Current plan is keep the code backwards compatible// and put work in elsewhere for new code (e.g. evolving behaviour for program action handler).//// The event 'command:*' is also listened for directly for testing for unknown commands// due to an example in the README, although this is not robust (e.g. sent for git-style commands).// due to an example in the README.//// Historical: the event 'command:*' used to also be shared by the action handler on the program.
describe(".command('*')", () => {105 unmodified linesExpand allmodified:Readme.md+8 added-8 removed
20 unmodified lines21 - [Version option](#version-option)22 - [Commands](#commands)23 - [Specify the argument syntax](#specify-the-argument-syntax)24 - [Action handler (sub)commands](#action-handler-subcommands)25- - [Git-style executable (sub)commands](#git-style-executable-subcommands)25+ - [Stand-alone executable (sub)commands](#stand-alone-executable-subcommands)26 - [Automated help](#automated-help)27 - [Custom help](#custom-help)28 - [.usage and .name](#usage-and-name)29 - [.help(cb)](#helpcb)5 unmodified lines35 - [Bits and pieces](#bits-and-pieces)36 - [Avoiding option name clashes](#avoiding-option-name-clashes)37 - [TypeScript](#typescript)38 - [Node options such as `--harmony`](#node-options-such-as---harmony)39- - [Debugging executable subcommands](#debugging-executable-subcommands)39+ - [Debugging stand-alone executable subcommands](#debugging-stand-alone-executable-subcommands)40 - [Override exit handling](#override-exit-handling)41 - [Examples](#examples)42 - [License](#license)43 - [Support](#support)253 unmodified lines297 ```298 299 ## Commands300 301-You can specify (sub)commands for your top-level command using `.command()` or `.addCommand()`. There are two ways these can be implemented: using an action handler attached to the command, or as a separate executable file (described in more detail later). The subcommands may be nested ([example](./examples/nestedCommands.js)).301+You can specify (sub)commands for your top-level command using `.command()` or `.addCommand()`. There are two ways these can be implemented: using an action handler attached to the command, or as a stand-alone executable file (described in more detail later). The subcommands may be nested ([example](./examples/nestedCommands.js)).302 303 In the first parameter to `.command()` you specify the command name and any command arguments. The arguments may be `<required>` or `[optional]`, and the last argument may also be `variadic...`.304 305 You can use `.addCommand()` to add an already configured subcommand to the program.9 unmodified lines315 .action((source, destination) => {316 console.log('clone command called');317 });318 319-// Command implemented using separate executable file (description is second parameter to `.command`)319+// Command implemented using stand-alone executable file (description is second parameter to `.command`)320 // Returns top-level command for adding more commands.321 program322 .command('start <service>', 'start named service')323 .command('stop [service]', 'stop named service, or all if no name supplied');87 unmodified lines411 ```412 413 A command's options on the command line are validated when the command is used. Any unknown options will be reported as an error.414 415-### Git-style executable (sub)commands415+### Stand-alone executable (sub)commands416 417-When `.command()` is invoked with a description argument, this tells commander that you're going to use separate executables for sub-commands, much like `git` and other popular tools.417+When `.command()` is invoked with a description argument, this tells Commander that you're going to use stand-alone executables for sub-commands.418 Commander will search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-subcommand`, like `pm-install`, `pm-search`.419 You can specify a custom name with the `executableFile` configuration option.420 421 You handle the options for an executable (sub)command in the executable, and don't declare them at the top-level.182 unmodified lines604 ### TypeScript605 606 The Commander package includes its TypeScript Definition file.607 608-If you use `ts-node` and git-style sub-commands written as `.ts` files, you need to call your program through node to get the sub-commands called correctly. e.g.608+If you use `ts-node` and stand-alone executable sub-commands written as `.ts` files, you need to call your program through node to get the sub-commands called correctly. e.g.609 610 ```bash611 node -r ts-node/register pm.ts612 ```4 unmodified lines617 618 - Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. (Note Windows does not support this pattern.)619 - Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning sub-command process.620 621-### Debugging executable subcommands621+### Debugging stand-alone executable subcommands622 623 An executable subcommand is launched as a separate child process.624 625 If you are using the node inspector for [debugging](https://nodejs.org/en/docs/guides/debugging-getting-started/) executable subcommands using `node --inspect` et al,79 unmodified lines