Skip to content

Commit

Permalink
Merge pull request #1269 from shadowspawn/feature/fix-typos
Browse files Browse the repository at this point in the history
Fix some typos
  • Loading branch information
shadowspawn committed May 30, 2020
2 parents 168ff5b + 24118fe commit 4a7148a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ program.version('0.0.1');

For larger programs which may use commander in multiple ways, including unit testing, it is better to create a local Command object to use.

```js
const { Command } = require('commander');
const program = new Command();
program.version('0.0.1');
```
```js
const { Command } = require('commander');
const program = new Command();
program.version('0.0.1');
```

## Options

Expand Down Expand Up @@ -668,7 +668,7 @@ this behaviour and optionally supply a callback. The default override throws a `
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
is not affected by the override which is called after the display.
``` js
```js
program.exitOverride();
try {
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ class Command extends EventEmitter {
return this._optionEx({}, flags, description, fn, defaultValue);
};

/*
/**
* Add a required option which must have a value after parsing. This usually means
* the option must be specified on the command line. (Otherwise the same as .option().)
*
Expand Down Expand Up @@ -891,7 +891,7 @@ class Command extends EventEmitter {
this._dispatchSubcommand(this._defaultCommandName, operands, unknown);
} else {
if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) {
// probaby missing subcommand and no handler, user needs help
// probably missing subcommand and no handler, user needs help
this._helpAndError();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/options.flags.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test('when only short flag defined and specified then value is true', () => {
expect(program.P).toBe(true);
});

// Sanity check that pepper is not true normally, as otherwise all the following tests would pass for thr wrong reasons!
// Sanity check that pepper is not true normally, as otherwise all the following tests would pass for the wrong reasons!
test('when only long flag defined and not specified then value is undefined', () => {
const program = new commander.Command();
program
Expand Down
2 changes: 1 addition & 1 deletion tests/options.opts.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const commander = require('../');

// Test the `.opts()` way of accesing option values.
// Test the `.opts()` way of accessing option values.
// Basic coverage of the main option types (leaving out negatable flags and options with optional values).

test('when .version used then version in opts', () => {
Expand Down
2 changes: 1 addition & 1 deletion typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ declare namespace commander {
* ```ts
* program
* .command('start <service>', 'start named service')
* .command('stop [service]', 'stop named serice, or all if no name supplied');
* .command('stop [service]', 'stop named service, or all if no name supplied');
* ```
*
* @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
Expand Down

0 comments on commit 4a7148a

Please sign in to comment.