Skip to content

Commit 591fc4b

Browse files
committed
Merge branch 'fix/grammar' of github.com:aweebit/commander.js into aweebit-fix/grammar
2 parents 03dea00 + 3b31a1f commit 591fc4b

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

Readme.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ serve --port=80
191191

192192
You can use `--` to indicate the end of the options, and any remaining arguments will be used without being interpreted.
193193

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.
195195

196196
There are additional related routines for when `.opts()` is not enough:
197197

@@ -234,7 +234,7 @@ pizza details:
234234
- cheese
235235
```
236236

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.
238238
For example `-d -s -p cheese` may be written as `-ds -p cheese` or even `-dsp cheese`.
239239

240240
Options with an expected option-argument are greedy and will consume the following argument whatever the value.
@@ -678,7 +678,7 @@ async function main() {
678678
}
679679
```
680680

681-
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 to
681+
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 to
682682
pass more arguments than declared, but you can make this an error with `.allowExcessArguments(false)`.
683683

684684
### Stand-alone executable (sub)commands
@@ -766,7 +766,7 @@ shell help spawn
766766
shell spawn --help
767767
```
768768

769-
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.)
769+
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.)
770770

771771
### Custom help
772772

@@ -854,8 +854,8 @@ error: unknown option '--hepl'
854854
The command name appears in the help, and is also used for locating stand-alone executable subcommands.
855855

856856
You may specify the program name using `.name()` or in the Command constructor. For the program, Commander will
857-
fallback to using the script name from the full arguments passed into `.parse()`. However, the script name varies
858-
depending on how your program is launched so you may wish to specify it explicitly.
857+
fall back to using the script name from the full arguments passed into `.parse()`. However, the script name varies
858+
depending on how your program is launched, so you may wish to specify it explicitly.
859859

860860
```js
861861
program.name('pizza');
@@ -897,7 +897,7 @@ This may require additional disk space.
897897

898898
### .helpOption(flags, description)
899899

900-
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.
900+
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.
901901

902902
```js
903903
program
@@ -971,7 +971,7 @@ program.parse(['-f', 'filename'], { from: 'user' });
971971

972972
If the default parsing does not suit your needs, there are some behaviours to support other usage patterns.
973973

974-
By default program options are recognised before and after subcommands. To only look for program options before subcommands, use `.enablePositionalOptions()`. This lets you use
974+
By default, program options are recognised before and after subcommands. To only look for program options before subcommands, use `.enablePositionalOptions()`. This lets you use
975975
an option for a different purpose in subcommands.
976976

977977
Example file: [positional-options.js](./examples/positional-options.js)
@@ -983,8 +983,8 @@ program -b subcommand
983983
program subcommand -b
984984
```
985985

986-
By default options are recognised before and after command-arguments. To only process options that come
987-
before the command-arguments, use `.passThroughOptions()`. This lets you pass the arguments and following options through to another program
986+
By default, options are recognised before and after command-arguments. To only process options that come
987+
before the command-arguments, use `.passThroughOptions()`. This lets you pass the arguments and following options through to another program
988988
without needing to use `--` to end the option processing.
989989
To use pass through options in a subcommand, the program needs to enable positional options.
990990

@@ -997,15 +997,15 @@ program --port=80 arg
997997
program arg --port=80
998998
```
999999

1000-
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.
1000+
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.
10011001

1002-
By default the argument processing does not display an error for more command-arguments than expected.
1002+
By default, the argument processing does not display an error for more command-arguments than expected.
10031003
To display an error for excess arguments, use`.allowExcessArguments(false)`.
10041004

10051005
### Legacy options as properties
10061006

10071007
Before Commander 7, the option values were stored as properties on the command.
1008-
This was convenient to code but the downside was possible clashes with
1008+
This was convenient to code, but the downside was possible clashes with
10091009
existing properties of `Command`. You can revert to the old behaviour to run unmodified legacy code by using `.storeOptionsAsProperties()`.
10101010

10111011
```js
@@ -1029,7 +1029,7 @@ See [commander-js/extra-typings](https://github.com/commander-js/extra-typings)
10291029
import { Command } from '@commander-js/extra-typings';
10301030
```
10311031

1032-
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.
1032+
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.
10331033

10341034
```sh
10351035
node -r ts-node/register pm.ts
@@ -1059,14 +1059,14 @@ You can enable `--harmony` option in two ways:
10591059

10601060
An executable subcommand is launched as a separate child process.
10611061

1062-
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,
1062+
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.,
10631063
the inspector port is incremented by 1 for the spawned subcommand.
10641064

10651065
If you are using VSCode to debug executable subcommands you need to set the `"autoAttachChildProcesses": true` flag in your launch.json configuration.
10661066

10671067
### npm run-script
10681068

1069-
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. Use
1069+
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. Use
10701070
`--` to stop the npm option parsing and pass through all the arguments.
10711071

10721072
The synopsis for [npm run-script](https://docs.npmjs.com/cli/v9/commands/npm-run-script) explicitly shows the `--` for this reason:
@@ -1089,7 +1089,7 @@ program.error('Custom processing has failed', { exitCode: 2, code: 'my.custom.er
10891089

10901090
### Override exit and output handling
10911091

1092-
By default Commander calls `process.exit` when it detects errors, or after displaying the help or version. You can override
1092+
By default, Commander calls `process.exit` when it detects errors, or after displaying the help or version. You can override
10931093
this behaviour and optionally supply a callback. The default override throws a `CommanderError`.
10941094

10951095
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 help
@@ -1105,7 +1105,7 @@ try {
11051105
}
11061106
```
11071107

1108-
By default Commander is configured for a command-line application and writes to stdout and stderr.
1108+
By default, Commander is configured for a command-line application and writes to stdout and stderr.
11091109
You can modify this behaviour for custom applications. In addition, you can modify the display of error messages.
11101110

11111111
Example file: [configure-output.js](./examples/configure-output.js)

docs/deprecated.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The newer functionality is the Option `.choices()` method, or using a custom opt
3434
This was an option passed to `.command()` to hide the command from the built-in help:
3535

3636
```js
37-
program.command('example', 'examnple command', { noHelp: true });
37+
program.command('example', 'example command', { noHelp: true });
3838
```
3939

4040
The option was renamed `hidden` in Commander v5.1. Deprecated from Commander v7.

docs/options-in-depth.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ and subtle issues in depth.
66

77
- [Options taking varying numbers of option-arguments](#options-taking-varying-numbers-of-option-arguments)
88
- [Parsing ambiguity](#parsing-ambiguity)
9-
- [Alternative: Make `--` part of your syntax](#alternative-make-----part-of-your-syntax)
9+
- [Alternative: Make `--` part of your syntax](#alternative-make----part-of-your-syntax)
1010
- [Alternative: Put options last](#alternative-put-options-last)
1111
- [Alternative: Use options instead of command-arguments](#alternative-use-options-instead-of-command-arguments)
1212
- [Combining short options, and options taking arguments](#combining-short-options-and-options-taking-arguments)
@@ -76,7 +76,7 @@ ingredient: cheese
7676

7777
If you want to avoid your users needing to learn when to use `--`, there are a few approaches you could take.
7878

79-
#### Alternative: Make `--` part of your syntax
79+
#### Alternative: Make `--` part of your syntax
8080

8181
Rather than trying to teach your users what `--` does, you could just make it part of your syntax.
8282

@@ -170,7 +170,7 @@ if (opts.halal) console.log(`halal servings: ${opts.halal}`);
170170
```sh
171171
$ collect -o 3
172172
other servings: 3
173-
$ collect -o3
173+
$ collect -o3
174174
other servings: 3
175175
$ collect -l -v
176176
vegan servings: true
@@ -194,7 +194,7 @@ Before Commander v5, combining a short option and the value was not supported, a
194194
So `-avl` expanded to `-a -v -l`.
195195

196196
If you want backwards compatible behaviour, or prefer combining short options as booleans to combining short option and value,
197-
you may change the behavior.
197+
you may change the behaviour.
198198

199199
To modify the parsing of options taking an optional value:
200200

0 commit comments

Comments
 (0)