Skip to content

Commit

Permalink
Make old and new code match
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowspawn committed Jan 11, 2024
1 parent da5e03e commit 30c60e9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/deprecated.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,20 +211,20 @@ Deprecated from Commander v11.
This was originally used with a variety of parameters, but not by passing a Command object despite the "add" name.

```js
program.addHelpCommand('HELP');
program.addHelpCommand('HELP', 'SHOW HELP');
program.addHelpCommand('assist [command]');
program.addHelpCommand('assist', 'show assistance');
program.addHelpCommand(false);

```

In new code you configure the help command with `.helpCommand()`. Or use `.addHelpCommand()` which now takes a Command object, like `.addCommand()`.

```js
program.helpCommand('HELP [command]');
program.helpCommand('HELP', 'show help');
program.helpCommand('assist [command]');
program.helpCommand('assist', 'show assistance');
program.helpCommand(false);

program.addHelpCommand(new Command('HELP').argument('[command]').description('show help'));
program.addHelpCommand(new Command('assist').argument('[command]').description('show assistance'));

```
## Removed
Expand Down

0 comments on commit 30c60e9

Please sign in to comment.