File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,11 @@ enum Subcommand: String, CaseIterable {
55
55
}
56
56
57
57
struct SwiftHelp : ParsableCommand {
58
- @Argument var topic : HelpTopic = . driver( . interactive)
58
+ @Argument ( help: " The topic to display help for. " )
59
+ var topic : HelpTopic = . driver( . interactive)
60
+
61
+ @Argument ( help: " The help subtopics, if applicable. " )
62
+ var subtopics : [ String ] = [ ]
59
63
60
64
@Flag ( name: . customLong( " show-hidden " , withSingleDash: true ) ,
61
65
help: " List hidden (unsupported) options " )
@@ -89,7 +93,11 @@ struct SwiftHelp: ParsableCommand {
89
93
}
90
94
91
95
// Execute the subcommand with --help.
92
- try exec ( path: path. pathString, args: [ execName, " --help " ] )
96
+ if subtopics. isEmpty {
97
+ try exec ( path: path. pathString, args: [ execName, " --help " ] )
98
+ } else {
99
+ try exec ( path: path. pathString, args: [ execName, " help " ] + subtopics)
100
+ }
93
101
}
94
102
}
95
103
}
You can’t perform that action at this time.
0 commit comments