File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1004,6 +1004,18 @@ const generateCommandHelpNew = (
10041004 */
10051005/* c8 ignore start -- only called from help paths that call process.exit() */
10061006const generateHelpNew = ( state : InternalCliState , theme : Theme ) : string => {
1007+ // Build options schema, adding --completion-script if completion is enabled
1008+ let options = state . globalParser ?. __optionsSchema ;
1009+ if ( state . options . completion ) {
1010+ options = {
1011+ ...options ,
1012+ 'completion-script' : {
1013+ description : 'Output shell completion script (bash, zsh, fish)' ,
1014+ type : 'string' as const ,
1015+ } ,
1016+ } ;
1017+ }
1018+
10071019 // Delegate to existing help generator with config including aliases
10081020 const config = {
10091021 commands : Object . fromEntries (
@@ -1016,7 +1028,7 @@ const generateHelpNew = (state: InternalCliState, theme: Theme): string => {
10161028 ) ,
10171029 description : state . options . description ,
10181030 name : state . name ,
1019- options : state . globalParser ?. __optionsSchema ,
1031+ options,
10201032 version : state . options . version ,
10211033 } ;
10221034 return generateHelp ( config as Parameters < typeof generateHelp > [ 0 ] , theme ) ;
You can’t perform that action at this time.
0 commit comments