Skip to content
Myr

Spell subcommand consistently without hyphen (#1177)

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

authored by John Gee · committed by GitHub · parent 6f3aebb · Browse files · 1 file+4 added−4 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+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:Readme.md+4 added-4 removed
413 unmodified lines
414A command's options on the command line are validated when the command is used. Any unknown options will be reported as an error.415416### Stand-alone executable (sub)commands417418When `.command()` is invoked with a description argument, this tells Commander that you're going to use stand-alone executables for sub-commands.418When `.command()` is invoked with a description argument, this tells Commander that you're going to use stand-alone executables for subcommands.419Commander will search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-subcommand`, like `pm-install`, `pm-search`.420You can specify a custom name with the `executableFile` configuration option.421422You handle the options for an executable (sub)command in the executable, and don't declare them at the top-level.
202 unmodified lines
625### TypeScript626627The Commander package includes its TypeScript Definition file.628629If 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.629If you use `ts-node` and stand-alone executable subcommands written as `.ts` files, you need to call your program through node to get the subcommands called correctly. e.g.630631```bash632node -r ts-node/register pm.ts633```
1 unmodified line
635### Node options such as `--harmony`636637You can enable `--harmony` option in two ways:638639- Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. (Note Windows does not support this pattern.)640- 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.639- Use `#! /usr/bin/env node --harmony` in the subcommands scripts. (Note Windows does not support this pattern.)640- Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning subcommand process.641642### Debugging stand-alone executable subcommands643644An executable subcommand is launched as a separate child process.
81 unmodified lines