Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanBaulch committed Oct 10, 2024
1 parent 0193201 commit a442adf
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Follow the existing code style. Check the tests succeed, including format and li
Don't update the CHANGELOG or package version number. That gets done by maintainers when preparing the release.
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.
add a dependency are much less likely to be accepted, and we are likely to ask for alternative approaches to avoid the dependency.
-->

## Problem
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ program

## 0.2.0 / 2011-09-26

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

## 0.1.0 / 2011-08-24

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ you should say so in your comments so we focus on the concept first before talki
- README
- examples/

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

- <https://devrant.com/rants/1854993/package-tsunami>
- <https://dev.to/leoat12/the-nodemodules-problem-29dc>
2 changes: 1 addition & 1 deletion docs/zh-CN/不再推荐使用的功能.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ program.option('-c,--coffee <type>', 'coffee', /short-white|long-black/);
此选项曾被用作传入`.command()`方法,以在内建的帮助信息中隐藏该命令:

```js
program.command('example', 'examnple command', { noHelp: true });
program.command('example', 'example command', { noHelp: true });
```

在 Commander v5.1 中,该选项被更名为`hidden`。自 Commander v7 起`noHelp`不再推荐使用。
Expand Down
8 changes: 4 additions & 4 deletions examples/custom-command-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CommandWithTrace extends commander.Command {
}
}

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

program
.command('serve [params...]')
.option('-p, --port <number>', 'port number')
.action((params, options, command) => {
inpectCommand(command);
inspectCommand(command);
});

program.command('build <target>').action((buildTarget, options, command) => {
inpectCommand(command);
inspectCommand(command);
});

program.parse();
Expand Down
6 changes: 3 additions & 3 deletions lib/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,11 @@ class Help {
);
}
if (extraInfo.length > 0) {
const extraDescripton = `(${extraInfo.join(', ')})`;
const extraDescription = `(${extraInfo.join(', ')})`;
if (argument.description) {
return `${argument.description} ${extraDescripton}`;
return `${argument.description} ${extraDescription}`;
}
return extraDescripton;
return extraDescription;
}
return argument.description;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/option.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class Option {

/**
* Return option name, in a camelcase format that can be used
* as a object attribute key.
* as an object attribute key.
*
* @return {string}
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/command.parseOptions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const util = require('util');

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

// Combination of parse and parseOptions tests which are are more about details
// Combination of parse and parseOptions tests which are more about details
// than high level behaviours which are tested elsewhere.

// Tests created from reported bugs
Expand Down Expand Up @@ -231,7 +231,7 @@ describe('parse and program.args', () => {
// Commander conformance:
// - allows separate argument for required option-argument
// - allows value in same argument for short flag with required option-argument
// - non-conforming: allows separate argument for optional option-argument if does not start with '-'
// - non-conforming: allows separate argument for optional option-argument if it does not start with '-'
// - allows value in same argument for short flag with optional option-argument
// - allows short flags as per 12.2
//
Expand Down
2 changes: 1 addition & 1 deletion tests/command.positionalOptions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ describe('program with action handler and passThrough and subcommand', () => {
expect(sub.opts().debug).toBe(true);
});

// This is somewhat of a side-affect of supporting previous test.
// This is somewhat of a side-effect of supporting previous test.
test('when shared option after subcommand then parsed by subcommand', () => {
const { program, sub } = makeProgram();
program.parse(['sub', '-g'], { from: 'user' });
Expand Down
2 changes: 1 addition & 1 deletion typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class Option {

/**
* Return option name, in a camelcase format that can be used
* as a object attribute key.
* as an object attribute key.
*/
attributeName(): string;

Expand Down
2 changes: 1 addition & 1 deletion typings/index.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as commander from './index';
import { expectType } from 'tsd';

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

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

Expand Down

0 comments on commit a442adf

Please sign in to comment.