Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some typos #1269

Merged
merged 1 commit into from
May 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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