Skip to content

Commit 3a79d84

Browse files
authored
Fix typos (#2264)
1 parent 0193201 commit 3a79d84

11 files changed

+17
-17
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Follow the existing code style. Check the tests succeed, including format and li
1111
Don't update the CHANGELOG or package version number. That gets done by maintainers when preparing the release.
1212
1313
Commander currently has zero production dependencies. That isn't a hard requirement, but is a simple story. Requests which
14-
add a dependency are much less likely to be accepted, and we are likely to ask if there alternative approaches to avoid the dependency.
14+
add a dependency are much less likely to be accepted, and we are likely to ask for alternative approaches to avoid the dependency.
1515
-->
1616

1717
## Problem

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ program
11351135

11361136
## 0.2.0 / 2011-09-26
11371137

1138-
* Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs]
1138+
* Allow for defaults that are not just boolean. Default reassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs]
11391139

11401140
## 0.1.0 / 2011-08-24
11411141

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ you should say so in your comments so we focus on the concept first before talki
3737
- README
3838
- examples/
3939

40-
Commander currently has zero production dependencies. That isn't a hard requirement, but is a simple story. Requests which add a dependency are much less likely to be accepted, and we are likely to ask if there alternative approaches to avoid the dependency.
40+
Commander currently has zero production dependencies. That isn't a hard requirement, but is a simple story. Requests which add a dependency are much less likely to be accepted, and we are likely to ask for alternative approaches to avoid the dependency.
4141

4242
- <https://devrant.com/rants/1854993/package-tsunami>
4343
- <https://dev.to/leoat12/the-nodemodules-problem-29dc>

docs/zh-CN/不再推荐使用的功能.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ program.option('-c,--coffee <type>', 'coffee', /short-white|long-black/);
3232
此选项曾被用作传入`.command()`方法,以在内建的帮助信息中隐藏该命令:
3333

3434
```js
35-
program.command('example', 'examnple command', { noHelp: true });
35+
program.command('example', 'example command', { noHelp: true });
3636
```
3737

3838
在 Commander v5.1 中,该选项被更名为`hidden`。自 Commander v7 起`noHelp`不再推荐使用。

examples/custom-command-class.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CommandWithTrace extends commander.Command {
1212
}
1313
}
1414

15-
function inpectCommand(command) {
15+
function inspectCommand(command) {
1616
// The option value is stored as property on command because we called .storeOptionsAsProperties()
1717
console.log(`Called '${command.name()}'`);
1818
console.log(`args: ${command.args}`);
@@ -22,18 +22,18 @@ function inpectCommand(command) {
2222
const program = new CommandWithTrace('program')
2323
.option('-v, ---verbose')
2424
.action((options, command) => {
25-
inpectCommand(command);
25+
inspectCommand(command);
2626
});
2727

2828
program
2929
.command('serve [params...]')
3030
.option('-p, --port <number>', 'port number')
3131
.action((params, options, command) => {
32-
inpectCommand(command);
32+
inspectCommand(command);
3333
});
3434

3535
program.command('build <target>').action((buildTarget, options, command) => {
36-
inpectCommand(command);
36+
inspectCommand(command);
3737
});
3838

3939
program.parse();

lib/help.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,11 @@ class Help {
350350
);
351351
}
352352
if (extraInfo.length > 0) {
353-
const extraDescripton = `(${extraInfo.join(', ')})`;
353+
const extraDescription = `(${extraInfo.join(', ')})`;
354354
if (argument.description) {
355-
return `${argument.description} ${extraDescripton}`;
355+
return `${argument.description} ${extraDescription}`;
356356
}
357-
return extraDescripton;
357+
return extraDescription;
358358
}
359359
return argument.description;
360360
}

lib/option.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class Option {
207207

208208
/**
209209
* Return option name, in a camelcase format that can be used
210-
* as a object attribute key.
210+
* as an object attribute key.
211211
*
212212
* @return {string}
213213
*/

tests/command.parseOptions.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const util = require('util');
55

66
const execFileAsync = util.promisify(childProcess.execFile);
77

8-
// Combination of parse and parseOptions tests which are are more about details
8+
// Combination of parse and parseOptions tests which are more about details
99
// than high level behaviours which are tested elsewhere.
1010

1111
// Tests created from reported bugs
@@ -231,7 +231,7 @@ describe('parse and program.args', () => {
231231
// Commander conformance:
232232
// - allows separate argument for required option-argument
233233
// - allows value in same argument for short flag with required option-argument
234-
// - non-conforming: allows separate argument for optional option-argument if does not start with '-'
234+
// - non-conforming: allows separate argument for optional option-argument if it does not start with '-'
235235
// - allows value in same argument for short flag with optional option-argument
236236
// - allows short flags as per 12.2
237237
//

tests/command.positionalOptions.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ describe('program with action handler and passThrough and subcommand', () => {
424424
expect(sub.opts().debug).toBe(true);
425425
});
426426

427-
// This is somewhat of a side-affect of supporting previous test.
427+
// This is somewhat of a side-effect of supporting previous test.
428428
test('when shared option after subcommand then parsed by subcommand', () => {
429429
const { program, sub } = makeProgram();
430430
program.parse(['sub', '-g'], { from: 'user' });

typings/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export class Option {
190190

191191
/**
192192
* Return option name, in a camelcase format that can be used
193-
* as a object attribute key.
193+
* as an object attribute key.
194194
*/
195195
attributeName(): string;
196196

typings/index.test-d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as commander from './index';
22
import { expectType } from 'tsd';
33

4-
// We are are not just checking return types here, we are also implicitly checking that the expected syntax is allowed.
4+
// We are not just checking return types here, we are also implicitly checking that the expected syntax is allowed.
55

66
/* eslint-disable @typescript-eslint/no-empty-function */
77

0 commit comments

Comments
 (0)