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 syntax errors in migration example #1692

Merged
merged 1 commit into from Feb 20, 2022
Merged
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
8 changes: 4 additions & 4 deletions CHANGELOG.md
Expand Up @@ -281,14 +281,14 @@ program
.command('compress <filename>')
.option('-t, --trace')
// Old code before Commander 7
.action((filename, cmd)) => {
.action((filename, cmd) => {
if (cmd.trace) console.log(`Command name is ${cmd.name()}`);
});
```

```js
// New code
.action((filename, options, command)) => {
.action((filename, options, command) => {
if (options.trace) console.log(`Command name is ${command.name()}`);
});
```
Expand All @@ -301,14 +301,14 @@ program
.storeOptionsAsProperties(false)
.option('-t, --trace')
// Old code before Commander 7
.action((filename, command)) => {
.action((filename, command) => {
if (command.opts().trace) console.log(`Command name is ${command.name()}`);
});
```

```js
// New code
.action((filename, options, command)) => {
.action((filename, options, command) => {
if (command.opts().trace) console.log(`Command name is ${command.name()}`);
});
```
Expand Down