From ee78d957d797df91d97a337464f8270e95c6dfd3 Mon Sep 17 00:00:00 2001 From: Raine Revere Date: Wed, 29 Mar 2023 13:12:19 -0400 Subject: [PATCH] Link to Help class in configure-help.js and README. --- Readme.md | 2 +- examples/configure-help.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 5f0444dde..72c5e29c8 100644 --- a/Readme.md +++ b/Readme.md @@ -919,7 +919,7 @@ The data properties are: - `sortOptions`: sort the options alphabetically - `showGlobalOptions`: show a section with the global options from the parent command(s) -There are methods getting the visible lists of arguments, options, and subcommands. There are methods for formatting the items in the lists, with each item having a _term_ and _description_. Take a look at `.formatHelp()` to see how they are used. +You can override any method on the [Help](./lib/help.js) class. There are methods getting the visible lists of arguments, options, and subcommands. There are methods for formatting the items in the lists, with each item having a _term_ and _description_. Take a look at `.formatHelp()` to see how they are used. Example file: [configure-help.js](./examples/configure-help.js) diff --git a/examples/configure-help.js b/examples/configure-help.js index 6766164ed..09b827d46 100644 --- a/examples/configure-help.js +++ b/examples/configure-help.js @@ -5,6 +5,8 @@ const program = new commander.Command(); // This example shows a simple use of configureHelp. // This is used as an example in the README. +// Any method on the Help class can be overridden +// See: https://github.com/tj/commander.js/blob/master/lib/help.js program.configureHelp({ sortSubcommands: true,