Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tj/commander.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v8.0.0
Choose a base ref
...
head repository: tj/commander.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v8.1.0
Choose a head ref
  • 8 commits
  • 16 files changed
  • 2 contributors

Commits on Jul 3, 2021

  1. Add copyInheritedSettings (#1557)

    * Factor out copySettings so can be used in programs using addCommand.
    
    * Fill out tests for properties for copySettings
    
    * Add TypeScript
    
    * Rename
    shadowspawn authored Jul 3, 2021
    Copy the full SHA
    5517d25 View commit details

Commits on Jul 9, 2021

  1. Copy the full SHA
    56c4108 View commit details

Commits on Jul 12, 2021

  1. Copy the full SHA
    4be69f1 View commit details
  2. Feature/argument arg explicit (#1567)

    * Add new methods
    
    * Add chain test
    
    * Add tests for Argument.required
    
    * Add typings for argRequired and argOptional
    shadowspawn authored Jul 12, 2021
    Copy the full SHA
    6f51e4a View commit details

Commits on Jul 18, 2021

  1. Update Chinese docs

    wangweixuan authored and abetomo committed Jul 18, 2021
    Copy the full SHA
    e6943c4 View commit details

Commits on Jul 27, 2021

  1. Prepare for 8.1

    shadowspawn authored and abetomo committed Jul 27, 2021
    Copy the full SHA
    a036bde View commit details
  2. Clarify that more than just README

    shadowspawn authored and abetomo committed Jul 27, 2021
    Copy the full SHA
    411ca95 View commit details
  3. Add link for version diff

    shadowspawn authored and abetomo committed Jul 27, 2021
    Copy the full SHA
    a9c9f17 View commit details
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -8,6 +8,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
<!-- markdownlint-disable MD024 -->
<!-- markdownlint-disable MD004 -->

## [8.1.0] (2021-07-27)

### Added

- `.copyInheritedSettings()` ([#1557])
- update Chinese translation updates for Commander v8 ([#1570])
- `Argument` methods for `.argRequired()` and `.argOptional()` ([#1567])

## [8.0.0] (2021-06-25)

### Added
@@ -369,8 +377,12 @@ program
[#1529]: https://github.com/tj/commander.js/pull/1529
[#1534]: https://github.com/tj/commander.js/pull/1534
[#1539]: https://github.com/tj/commander.js/pull/1539
[#1557]: https://github.com/tj/commander.js/pull/1557
[#1567]: https://github.com/tj/commander.js/pull/1567
[#1570]: https://github.com/tj/commander.js/pull/1570

[Unreleased]: https://github.com/tj/commander.js/compare/master...develop
[8.1.0]: https://github.com/tj/commander.js/compare/v8.0.0...v8.1.0
[8.0.0]: https://github.com/tj/commander.js/compare/v7.2.0...v8.0.0
[8.0.0-2]: https://github.com/tj/commander.js/compare/v8.0.0-1...v8.0.0-2
[8.0.0-1]: https://github.com/tj/commander.js/compare/v8.0.0-0...v8.0.0-1
22 changes: 11 additions & 11 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -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)

@@ -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)).
@@ -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.
@@ -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)
@@ -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)
@@ -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:
@@ -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
@@ -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.
@@ -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)
@@ -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
@@ -986,7 +986,7 @@ Examples:
$ deploy exec sequential
$ deploy exec async`
);
program.parse(process.argv);
```
Loading