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

Update Chinese translations #1570

Merged
merged 1 commit into from Jul 18, 2021
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
22 changes: 11 additions & 11 deletions Readme.md
Expand Up @@ -113,7 +113,7 @@ By default options on the command line are not positional, and can be specified
### Common option types, boolean and value

The two most used option types are a boolean option, and an option which takes its value
from the following argument (declared with angle brackets like `--expect <value>`). Both are `undefined` unless specified on command line.
from the following argument (declared with angle brackets like `--expect <value>`). Both are `undefined` unless specified on command line.

Example file: [options-common.js](./examples/options-common.js)

Expand Down Expand Up @@ -426,7 +426,7 @@ program
.addCommand(build.makeBuildCommand());
```

Configuration options can be passed with the call to `.command()` and `.addCommand()`. Specifying `hidden: true` will
Configuration options can be passed with the call to `.command()` and `.addCommand()`. Specifying `hidden: true` will
remove the command from the generated help output. Specifying `isDefault: true` will run the subcommand if no other
subcommand is specified ([example](./examples/defaultCommand.js)).

Expand All @@ -436,7 +436,7 @@ For subcommands, you can specify the argument syntax in the call to `.command()`
is the only method usable for subcommands implemented using a stand-alone executable, but for other subcommands
you can instead use the following method.

To configure a command, you can use `.argument()` to specify each expected command-argument.
To configure a command, you can use `.argument()` to specify each expected command-argument.
You supply the argument name and an optional description. The argument may be `<required>` or `[optional]`.
You can specify a default value for an optional command-argument.

Expand Down Expand Up @@ -513,7 +513,7 @@ program
### Action handler

The action handler gets passed a parameter for each command-argument you declared, and two additional parameters
which are the parsed options and the command object itself.
which are the parsed options and the command object itself.

Example file: [thank.js](./examples/thank.js)

Expand Down Expand Up @@ -630,7 +630,7 @@ shell spawn --help

### Custom help

You can add extra text to be displayed along with the built-in help.
You can add extra text to be displayed along with the built-in help.

Example file: [custom-help](./examples/custom-help)

Expand Down Expand Up @@ -664,7 +664,7 @@ The positions in order displayed are:
- `after`: display extra information after built-in help
- `afterAll`: add to the program for a global footer (epilog)

The positions "beforeAll" and "afterAll" apply to the command and all its subcommands.
The positions "beforeAll" and "afterAll" apply to the command and all its subcommands.

The second parameter can be a string, or a function returning a string. The function is passed a context object for your convenience. The properties are:

Expand All @@ -673,7 +673,7 @@ The second parameter can be a string, or a function returning a string. The func

### Display help after errors

The default behaviour for usage errors is to just display a short error message.
The default behaviour for usage errors is to just display a short error message.
You can change the behaviour to show the full help or a custom help message after an error.

```js
Expand Down Expand Up @@ -747,7 +747,7 @@ There are methods getting the visible lists of arguments, options, and subcomman

Example file: [configure-help.js](./examples/configure-help.js)

```
```js
program.configureHelp({
sortSubcommands: true,
subcommandTerm: (cmd) => cmd.name() // Just show the name, instead of short usage.
Expand Down Expand Up @@ -809,7 +809,7 @@ program subcommand -b

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

Example file: [pass-through-options.js](./examples/pass-through-options.js)
Expand All @@ -826,7 +826,7 @@ By default the option processing shows an error for an unknown option. To have a
By default the argument processing does not display an error for more command-arguments than expected.
To display an error for excess arguments, use`.allowExcessArguments(false)`.

### Legacy options as properties
### Legacy options as properties

Before Commander 7, the option values were stored as properties on the command.
This was convenient to code but the downside was possible clashes with
Expand Down Expand Up @@ -986,7 +986,7 @@ Examples:
$ deploy exec sequential
$ deploy exec async`
);

program.parse(process.argv);
```

Expand Down