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 1
1
import { LoggerService , LogLevel } from '@nestjs/common' ;
2
2
import { NestApplicationContextOptions } from '@nestjs/common/interfaces/nest-application-context-options.interface' ;
3
- import { OutputConfiguration } from 'commander' ;
3
+ import { Help , OutputConfiguration } from 'commander' ;
4
4
import type { CompletionFactoryOptions } from './completion.factory.interface' ;
5
5
6
6
export type ErrorHandler = ( err : Error ) => void ;
@@ -22,6 +22,7 @@ export interface CommandFactoryRunOptions
22
22
enablePositionalOptions ?: boolean ;
23
23
enablePassThroughOptions ?: boolean ;
24
24
outputConfiguration ?: OutputConfiguration ;
25
+ helpConfiguration ?: Help ;
25
26
version ?: string ;
26
27
27
28
/**
Original file line number Diff line number Diff line change @@ -54,6 +54,9 @@ ${cliPluginError(
54
54
this . options . pluginsAvailable ,
55
55
) } `) ;
56
56
}
57
+ if ( this . options . helpConfiguration ) {
58
+ this . commander . configureHelp ( this . options . helpConfiguration ) ;
59
+ }
57
60
if ( this . options . errorHandler ) {
58
61
this . commander . exitOverride ( this . options . errorHandler ) ;
59
62
}
@@ -134,6 +137,9 @@ ${cliPluginError(
134
137
if ( this . options . outputConfiguration ) {
135
138
newCommand . configureOutput ( this . options . outputConfiguration ) ;
136
139
}
140
+ if ( this . options . helpConfiguration ) {
141
+ newCommand . configureHelp ( this . options . helpConfiguration ) ;
142
+ }
137
143
if ( command . command . arguments ) {
138
144
this . mapArgumentDescriptions (
139
145
newCommand ,
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ export class CommandFactory {
98
98
options . enablePassThroughOptions || false ;
99
99
options . outputConfiguration = options . outputConfiguration || undefined ;
100
100
options . completion = options . completion || false ;
101
+ options . helpConfiguration = options . helpConfiguration || undefined ;
101
102
102
103
return options as DefinedCommandFactoryRunOptions ;
103
104
}
You can’t perform that action at this time.
0 commit comments