File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,11 @@ const commandListSubCommandDisplay = function (commands) {
100
100
let table = '| Subcommand | description |\n'
101
101
table += '|:--------------------------- |:-----|\n'
102
102
commands . forEach ( ( cmd ) => {
103
- const [ commandBase ] = cmd . name . split ( ':' )
103
+ let commandBase
104
+ commandBase = cmd . name . split ( ':' ) [ 0 ]
105
+ if ( cmd . parent ) {
106
+ commandBase = cmd . parent
107
+ }
104
108
const baseUrl = `/commands/${ commandBase } `
105
109
const slug = cmd . name . replace ( / : / g, '' )
106
110
table += `| [\`${ cmd . name } \`](${ baseUrl } #${ slug } ) | ${ cmd . description . split ( '\n' ) [ 0 ] } |\n`
Original file line number Diff line number Diff line change @@ -35,12 +35,13 @@ const parseCommand = function (command) {
35
35
} , { } )
36
36
37
37
return {
38
+ parent : command . parent ?. name ( ) !== "netlify" ? command . parent ?. name ( ) : undefined ,
38
39
name : command . name ( ) ,
39
40
description : command . description ( ) ,
40
- commands : commands
41
-
42
- . filter ( ( cmd ) => cmd . name ( ) . startsWith ( `${ command . name ( ) } :` ) && ! cmd . _hidden )
43
- . map ( ( cmd ) => parseCommand ( cmd ) ) ,
41
+ commands : [
42
+ ... command . commands . filter ( cmd => ! cmd . _hidden ) . map ( cmd => parseCommand ( cmd ) ) ,
43
+ ... commands . filter ( ( cmd ) => cmd . name ( ) . startsWith ( `${ command . name ( ) } :` ) && ! cmd . _hidden ) . map ( cmd => parseCommand ( cmd ) )
44
+ ] ,
44
45
examples : command . examples . length !== 0 && command . examples ,
45
46
args : args . length !== 0 && args ,
46
47
flags : Object . keys ( flags ) . length !== 0 && flags ,
You can’t perform that action at this time.
0 commit comments