File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Sources/ArgumentParser/Usage Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -265,6 +265,13 @@ fileprivate extension CommandConfiguration {
265
265
}
266
266
267
267
fileprivate extension NameSpecification {
268
+ /// Generates a list of `Name`s for the help command at any visibility level.
269
+ ///
270
+ /// If the `default` visibility is used, the help names are returned
271
+ /// unmodified. If a non-default visibility is used the short names are
272
+ /// removed and the long names (both single and double dash) are appended with
273
+ /// the name of the visibility level. After the optional name modification
274
+ /// step, the name are returned in descending order.
268
275
func generateHelpNames( visibility: ArgumentVisibility ) -> [ Name ] {
269
276
self
270
277
. makeNames ( InputKey ( rawValue: " help " ) )
@@ -285,8 +292,11 @@ fileprivate extension NameSpecification {
285
292
}
286
293
287
294
internal extension BidirectionalCollection where Element == ParsableCommand . Type {
295
+ /// Returns a list of help names at the request visibility level for the top
296
+ /// most ParsableCommand in the command stack with custom helpNames. If the
297
+ /// command stack contains no custom help names the default help names.
288
298
func getHelpNames( visibility: ArgumentVisibility ) -> [ Name ] {
289
- return self . last ( where: { $0. configuration. helpNames != nil } )
299
+ self . last ( where: { $0. configuration. helpNames != nil } )
290
300
. map { $0. configuration. helpNames!. generateHelpNames ( visibility: visibility) }
291
301
?? CommandConfiguration . defaultHelpNames. generateHelpNames ( visibility: visibility)
292
302
}
You can’t perform that action at this time.
0 commit comments