File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -15,17 +15,20 @@ if (!testVersion(process.version.substring(1), MINIMUM_REQUIRED_NODEJS_VERSION))
1515
1616if ( process . stdin . isTTY && ! hasSrcPaths ) {
1717 /* eslint-disable prefer-named-capture-group */
18- console . log ( config
19- . helpText ( )
18+ const renderForPipe = text => text ;
19+ const renderForTTY = text => text
2020 // Drop "-" from list of args
2121 . replace ( / \n - \s / g, ( ) => '\n ' )
2222 // Stylize shell commands
2323 . replace ( / ` ` ` s h \n + ( [ \w \W ] + ?) \n + ` ` ` / g, ( _ , sh ) => `\u001b[1m${ sh } \u001b[0m` )
2424 // Embolden Markdown stuff
2525 . replace ( / \* \* ( [ ^ * ] + ?) \* \* / g, ( _ , bold ) => `\u001b[7;1m${ bold } \u001b[0m` )
2626 // Italicize Markdown stuff
27- . replace ( / \* ( [ ^ * ] + ?) \* / g, ( _ , italic ) => `\u001b[1m${ italic } \u001b[0m` ) ) ;
27+ . replace ( / \* ( [ ^ * ] + ?) \* / g, ( _ , italic ) => `\u001b[1m${ italic } \u001b[0m` ) ;
2828 /* eslint-enable prefer-named-capture-group */
29+ const render = process . stdout . isTTY ? renderForTTY : renderForPipe ;
30+
31+ console . log ( render ( config . helpText ( ) ) ) ;
2932 process . exit ( ) ;
3033}
3134
You can’t perform that action at this time.
0 commit comments