Fix grammar in docs
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Wee Bit · committed by Wee Bit · parent d038570 · Browse files · 3 files·+24 added−24 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+24 added−24 removed
- other:+24 added−24 removed
Provenance
- Commit
3b31a1f- Tree
383c643- Author
Wee Bit <aweebit64@gmail.com>- Committer
Wee Bit <aweebit64@gmail.com>- Parent
d038570
3 files changed+24 added−24 removed
modified:docs/deprecated.md+1 added-1 removed
31 unmodified lines32 33 This was an option passed to `.command()` to hide the command from the built-in help:34 35 ```js36-program.command('example', 'examnple command', { noHelp: true });36+program.command('example', 'example command', { noHelp: true });37 ```38 39 The option was renamed `hidden` in Commander v5.1. Deprecated from Commander v7.40 169 unmodified linesmodified:docs/options-taking-varying-arguments.md+5 added-5 removed
3 unmodified lines4 and subtle issues in depth.5 6 - [Options taking varying numbers of option-arguments](#options-taking-varying-numbers-of-option-arguments)7 - [Parsing ambiguity](#parsing-ambiguity)8- - [Alternative: Make `--` part of your syntax](#alternative-make-----part-of-your-syntax)8+ - [Alternative: Make `--` part of your syntax](#alternative-make----part-of-your-syntax)9 - [Alternative: Put options last](#alternative-put-options-last)10 - [Alternative: Use options instead of command-arguments](#alternative-use-options-instead-of-command-arguments)11 - [Combining short options, and options taking arguments](#combining-short-options-and-options-taking-arguments)12 - [Combining short options as if boolean](#combining-short-options-as-if-boolean)59 unmodified lines72 ```73 74 If you want to avoid your users needing to learn when to use `--`, there are a few approaches you could take.75 76-### Alternative: Make `--` part of your syntax76+### Alternative: Make `--` part of your syntax77 78 Rather than trying to teach your users what `--` does, you could just make it part of your syntax.79 80 ```js85 unmodified lines166 167 ```sh168 $ collect -o 3169 other servings: 3170-$ collect -o3 170+$ collect -o3171 other servings: 3172 $ collect -l -v173 vegan servings: true174 halal servings: true14 unmodified lines189 190 Before Commander v5, combining a short option and the value was not supported, and combined short flags were always expanded.191 So `-avl` expanded to `-a -v -l`.192 193-If you want backwards compatible behaviour, or prefer combining short options as booleans to combining short option and value, 194-you may change the behavior.193+If you want backwards compatible behaviour, or prefer combining short options as booleans to combining short option and value,194+you may change the behaviour.195 196 To modify the parsing of options taking an optional value:197 198 ```js3 unmodified linesmodified:Readme.md+18 added-18 removed
189 unmodified lines190 ```191 192 You can use `--` to indicate the end of the options, and any remaining arguments will be used without being interpreted.193 194-By default options on the command line are not positional, and can be specified before or after other arguments.194+By default, options on the command line are not positional, and can be specified before or after other arguments.195 196 There are additional related routines for when `.opts()` is not enough:197 198 - `.optsWithGlobals()` returns merged local and global option values34 unmodified lines233 pizza details:234 - cheese235 ```236 237-Multiple boolean short options may be combined together following the dash, and may be followed by a single short option taking a value.237+Multiple boolean short options may be combined following the dash, and may be followed by a single short option taking a value.238 For example `-d -s -p cheese` may be written as `-ds -p cheese` or even `-dsp cheese`.239 240 Options with an expected option-argument are greedy and will consume the following argument whatever the value.241 So `--id -xyz` reads `-xyz` as the option-argument.433 unmodified lines675 await program.parseAsync(process.argv);676 }677 ```678 679-A command's options and arguments on the command line are validated when the command is used. Any unknown options or missing arguments will be reported as an error. You can suppress the unknown option checks with `.allowUnknownOption()`. By default it is not an error to679+A command's options and arguments on the command line are validated when the command is used. Any unknown options or missing arguments will be reported as an error. You can suppress the unknown option checks with `.allowUnknownOption()`. By default, it is not an error to680 pass more arguments than declared, but you can make this an error with `.allowExcessArguments(false)`.681 682 ### Stand-alone executable (sub)commands683 79 unmodified lines763 shell help spawn764 shell spawn --help765 ```766 767-Long descriptions are wrapped to fit the available width. (However, a description that includes a line-break followed by whitespace is assumed to be pre-formatted and not wrapped.)767+Long descriptions are wrapped to fit the available width. (However, a description that includes a line-break followed by whitespace is assumed to be pre-formatted and not wrapped.)768 769 ### Custom help770 771 You can add extra text to be displayed along with the built-in help.79 unmodified lines851 852 The command name appears in the help, and is also used for locating stand-alone executable subcommands.853 854 You may specify the program name using `.name()` or in the Command constructor. For the program, Commander will855-fallback to using the script name from the full arguments passed into `.parse()`. However, the script name varies856-depending on how your program is launched so you may wish to specify it explicitly.855+fall back to using the script name from the full arguments passed into `.parse()`. However, the script name varies856+depending on how your program is launched, so you may wish to specify it explicitly.857 858 ```js859 program.name('pizza');860 const pm = new Command('pm');33 unmodified lines894 ```895 896 ### .helpOption(flags, description)897 898-By default every command has a help option. You may change the default help flags and description. Pass false to disable the built-in help option.898+By default, every command has a help option. You may change the default help flags and description. Pass false to disable the built-in help option.899 900 ```js901 program902 .helpOption('-e, --HELP', 'read more information');65 unmodified lines968 ### Parsing Configuration969 970 If the default parsing does not suit your needs, there are some behaviours to support other usage patterns.971 972-By default program options are recognised before and after subcommands. To only look for program options before subcommands, use `.enablePositionalOptions()`. This lets you use972+By default, program options are recognised before and after subcommands. To only look for program options before subcommands, use `.enablePositionalOptions()`. This lets you use973 an option for a different purpose in subcommands.974 975 Example file: [positional-options.js](./examples/positional-options.js)976 3 unmodified lines980 program -b subcommand981 program subcommand -b982 ```983 984-By default options are recognised before and after command-arguments. To only process options that come985-before the command-arguments, use `.passThroughOptions()`. This lets you pass the arguments and following options through to another program984+By default, options are recognised before and after command-arguments. To only process options that come985+before the command-arguments, use `.passThroughOptions()`. This lets you pass the arguments and following options through to another program986 without needing to use `--` to end the option processing.987 To use pass through options in a subcommand, the program needs to enable positional options.988 989 Example file: [pass-through-options.js](./examples/pass-through-options.js)4 unmodified lines994 program --port=80 arg995 program arg --port=80996 ```997 998-By default the option processing shows an error for an unknown option. To have an unknown option treated as an ordinary command-argument and continue looking for options, use `.allowUnknownOption()`. This lets you mix known and unknown options.998+By default, the option processing shows an error for an unknown option. To have an unknown option treated as an ordinary command-argument and continue looking for options, use `.allowUnknownOption()`. This lets you mix known and unknown options.999 1000-By default the argument processing does not display an error for more command-arguments than expected.1000+By default, the argument processing does not display an error for more command-arguments than expected.1001 To display an error for excess arguments, use`.allowExcessArguments(false)`.1002 1003 ### Legacy options as properties1004 1005 Before Commander 7, the option values were stored as properties on the command.1006-This was convenient to code but the downside was possible clashes with1006+This was convenient to code, but the downside was possible clashes with1007 existing properties of `Command`. You can revert to the old behaviour to run unmodified legacy code by using `.storeOptionsAsProperties()`.1008 1009 ```js1010 program15 unmodified lines1026 ```1027 import { Command } from '@commander-js/extra-typings';1028 ```1029 1030-ts-node: If 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.1030+ts-node: If 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.1031 1032 ```sh1033 node -r ts-node/register pm.ts1034 ```21 unmodified lines1056 ### Debugging stand-alone executable subcommands1057 1058 An executable subcommand is launched as a separate child process.1059 1060-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,1060+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.,1061 the inspector port is incremented by 1 for the spawned subcommand.1062 1063 If you are using VSCode to debug executable subcommands you need to set the `"autoAttachChildProcesses": true` flag in your launch.json configuration.1064 1065 ### npm run-script1066 1067-By default when you call your program using run-script, `npm` will parse any options on the command-line and they will not reach your program. Use1067+By default, when you call your program using run-script, `npm` will parse any options on the command-line and they will not reach your program. Use1068 `--` to stop the npm option parsing and pass through all the arguments.1069 1070 The synopsis for [npm run-script](https://docs.npmjs.com/cli/v9/commands/npm-run-script) explicitly shows the `--` for this reason:1071 14 unmodified lines1086 ```1087 1088 ### Override exit and output handling1089 1090-By default Commander calls `process.exit` when it detects errors, or after displaying the help or version. You can override1090+By default, Commander calls `process.exit` when it detects errors, or after displaying the help or version. You can override1091 this behaviour and optionally supply a callback. The default override throws a `CommanderError`.1092 1093 The override callback is passed a `CommanderError` with properties `exitCode` number, `code` string, and `message`. The default override behaviour is to throw the error, except for async handling of executable subcommand completion which carries on. The normal display of error messages or version or help1094 is not affected by the override which is called after the display.7 unmodified lines1102 // custom processing...1103 }1104 ```1105 1106-By default Commander is configured for a command-line application and writes to stdout and stderr.1106+By default, Commander is configured for a command-line application and writes to stdout and stderr.1107 You can modify this behaviour for custom applications. In addition, you can modify the display of error messages.1108 1109 Example file: [configure-output.js](./examples/configure-output.js)1110 36 unmodified lines