File tree Expand file tree Collapse file tree 4 files changed +15
-1
lines changed
packages/nest-commander/src Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' nest-commander ' : minor
3+ ---
4+
5+ feat: Add option for Help Configuration using the .configureHelp() function in
6+ commander js
Original file line number Diff line number Diff line change 11import { LoggerService , LogLevel } from '@nestjs/common' ;
22import { NestApplicationContextOptions } from '@nestjs/common/interfaces/nest-application-context-options.interface' ;
3- import { OutputConfiguration } from 'commander' ;
3+ import { Help , OutputConfiguration } from 'commander' ;
44import type { CompletionFactoryOptions } from './completion.factory.interface' ;
55
66export type ErrorHandler = ( err : Error ) => void ;
@@ -22,6 +22,7 @@ export interface CommandFactoryRunOptions
2222 enablePositionalOptions ?: boolean ;
2323 enablePassThroughOptions ?: boolean ;
2424 outputConfiguration ?: OutputConfiguration ;
25+ helpConfiguration ?: Help ;
2526 version ?: string ;
2627
2728 /**
Original file line number Diff line number Diff line change @@ -54,6 +54,9 @@ ${cliPluginError(
5454 this . options . pluginsAvailable ,
5555) } `) ;
5656 }
57+ if ( this . options . helpConfiguration ) {
58+ this . commander . configureHelp ( this . options . helpConfiguration ) ;
59+ }
5760 if ( this . options . errorHandler ) {
5861 this . commander . exitOverride ( this . options . errorHandler ) ;
5962 }
@@ -134,6 +137,9 @@ ${cliPluginError(
134137 if ( this . options . outputConfiguration ) {
135138 newCommand . configureOutput ( this . options . outputConfiguration ) ;
136139 }
140+ if ( this . options . helpConfiguration ) {
141+ newCommand . configureHelp ( this . options . helpConfiguration ) ;
142+ }
137143 if ( command . command . arguments ) {
138144 this . mapArgumentDescriptions (
139145 newCommand ,
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ export class CommandFactory {
9898 options . enablePassThroughOptions || false ;
9999 options . outputConfiguration = options . outputConfiguration || undefined ;
100100 options . completion = options . completion || false ;
101+ options . helpConfiguration = options . helpConfiguration || undefined ;
101102
102103 return options as DefinedCommandFactoryRunOptions ;
103104 }
You can’t perform that action at this time.
0 commit comments