Skip to content

Commit 02778e3

Browse files
committed
feat: Add API to get command names
1 parent 53da00d commit 02778e3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/Commander/Group.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ open class Group : CommandType {
4848
}
4949

5050
var commands = [SubCommand]()
51+
public var commandNames: [String] {
52+
return commands.map { $0.name }
53+
}
5154

5255
// When set, allows you to override the default unknown command behaviour
5356
public var unknownCommand: ((_ name: String, _ parser: ArgumentParser) throws -> ())?

0 commit comments

Comments
 (0)