Skip to content

Commit 3b31a1f

Browse files
committed
Fix grammar in docs
1 parent d038570 commit 3b31a1f

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
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.
@@ -676,7 +676,7 @@ async function main() {
676676
}
677677
```
678678

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

682682
### Stand-alone executable (sub)commands
@@ -764,7 +764,7 @@ shell help spawn
764764
shell spawn --help
765765
```
766766

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.)
768768

769769
### Custom help
770770

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

854854
You may specify the program name using `.name()` or in the Command constructor. For the program, Commander will
855-
fallback to using the script name from the full arguments passed into `.parse()`. However, the script name varies
856-
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 varies
856+
depending on how your program is launched, so you may wish to specify it explicitly.
857857

858858
```js
859859
program.name('pizza');
@@ -895,7 +895,7 @@ This may require additional disk space.
895895

896896
### .helpOption(flags, description)
897897

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

900900
```js
901901
program
@@ -969,7 +969,7 @@ program.parse(['-f', 'filename'], { from: 'user' });
969969

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

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

975975
Example file: [positional-options.js](./examples/positional-options.js)
@@ -981,8 +981,8 @@ program -b subcommand
981981
program subcommand -b
982982
```
983983

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

@@ -995,15 +995,15 @@ program --port=80 arg
995995
program arg --port=80
996996
```
997997

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

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.
10011001
To display an error for excess arguments, use`.allowExcessArguments(false)`.
10021002

10031003
### Legacy options as properties
10041004

10051005
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 with
1006+
This was convenient to code, but the downside was possible clashes with
10071007
existing properties of `Command`. You can revert to the old behaviour to run unmodified legacy code by using `.storeOptionsAsProperties()`.
10081008

10091009
```js
@@ -1027,7 +1027,7 @@ See [commander-js/extra-typings](https://github.com/commander-js/extra-typings)
10271027
import { Command } from '@commander-js/extra-typings';
10281028
```
10291029

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

10321032
```sh
10331033
node -r ts-node/register pm.ts
@@ -1057,14 +1057,14 @@ You can enable `--harmony` option in two ways:
10571057

10581058
An executable subcommand is launched as a separate child process.
10591059

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.,
10611061
the inspector port is incremented by 1 for the spawned subcommand.
10621062

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

10651065
### npm run-script
10661066

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. Use
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. Use
10681068
`--` to stop the npm option parsing and pass through all the arguments.
10691069

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

10881088
### Override exit and output handling
10891089

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

10931093
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
@@ -1103,7 +1103,7 @@ try {
11031103
}
11041104
```
11051105

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.
11071107
You can modify this behaviour for custom applications. In addition, you can modify the display of error messages.
11081108

11091109
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
@@ -33,7 +33,7 @@ The newer functionality is the Option `.choices()` method, or using a custom opt
3333
This was an option passed to `.command()` to hide the command from the built-in help:
3434

3535
```js
36-
program.command('example', 'examnple command', { noHelp: true });
36+
program.command('example', 'example command', { noHelp: true });
3737
```
3838

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

docs/options-taking-varying-arguments.md

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

66
- [Options taking varying numbers of option-arguments](#options-taking-varying-numbers-of-option-arguments)
77
- [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)
99
- [Alternative: Put options last](#alternative-put-options-last)
1010
- [Alternative: Use options instead of command-arguments](#alternative-use-options-instead-of-command-arguments)
1111
- [Combining short options, and options taking arguments](#combining-short-options-and-options-taking-arguments)
@@ -73,7 +73,7 @@ ingredient: cheese
7373

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

76-
### Alternative: Make `--` part of your syntax
76+
### Alternative: Make `--` part of your syntax
7777

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

@@ -167,7 +167,7 @@ if (opts.halal) console.log(`halal servings: ${opts.halal}`);
167167
```sh
168168
$ collect -o 3
169169
other servings: 3
170-
$ collect -o3
170+
$ collect -o3
171171
other servings: 3
172172
$ collect -l -v
173173
vegan servings: true
@@ -190,8 +190,8 @@ halal servings: true
190190
Before Commander v5, combining a short option and the value was not supported, and combined short flags were always expanded.
191191
So `-avl` expanded to `-a -v -l`.
192192

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

196196
To modify the parsing of options taking an optional value:
197197

0 commit comments

Comments
 (0)