@@ -8,8 +8,17 @@ class HelpGroup {
88 l ( ) {
99 const c = chalk . cyan ;
1010 }
11- outputHelp ( ) {
12- process . stdout . write ( this . run ( ) . outputOptions . help ) ;
11+ outputHelp ( command = null ) {
12+ if ( command != null ) {
13+ const commands = require ( '../utils/commands' ) . info ;
14+ const options = commands . find ( cmd => ( cmd . name == command || cmd . alias == command ) ) ;
15+ const { bold } = chalk . white ;
16+ const usage = chalk . keyword ( 'orange' ) ( 'webpack ' + options . usage ) ;
17+ const description = options . description ;
18+ process . stdout . write ( `${ bold ( 'Usage' ) } : ${ usage } \n${ bold ( 'Description' ) } : ${ description } \n` ) ;
19+ } else {
20+ process . stdout . write ( this . run ( ) . outputOptions . help ) ;
21+ }
1322 process . stdout . write ( '\n Made with ♥️ by the webpack team \n' ) ;
1423 }
1524
@@ -20,16 +29,6 @@ class HelpGroup {
2029 process . stdout . write ( `\nwebpack ${ webpack . version } \n` ) ;
2130 }
2231
23- outputCommand ( command ) {
24- const commands = require ( '../utils/commands' ) . info ;
25- const options = commands . find ( cmd => ( cmd . name == command || cmd . alias == command ) ) ;
26- const { bold } = chalk . white ;
27- const usage = chalk . keyword ( 'orange' ) ( 'webpack ' + options . usage ) ;
28- const description = options . description ;
29- process . stdout . write ( `${ bold ( 'Usage' ) } : ${ usage } \n${ bold ( 'Description' ) } : ${ description } \n` ) ;
30- process . stdout . write ( '\n Made with ♥️ by the webpack team \n' ) ;
31- }
32-
3332 run ( ) {
3433 const { underline, bold } = chalk . white
3534 const o = s => chalk . keyword ( 'orange' ) ( s ) ;
0 commit comments