diff --git a/products/llbuildSwift/BuildSystemBindings.swift b/products/llbuildSwift/BuildSystemBindings.swift index 6f876d70d..1cf982609 100644 --- a/products/llbuildSwift/BuildSystemBindings.swift +++ b/products/llbuildSwift/BuildSystemBindings.swift @@ -157,7 +157,7 @@ public struct Diagnostic { } /// Handle for a command as invoked by the low-level BuildSystem. -public struct Command: Hashable { +public struct Command: Hashable, CustomStringConvertible, CustomDebugStringConvertible { fileprivate let handle: OpaquePointer? fileprivate init(_ handle: OpaquePointer?) { @@ -188,6 +188,19 @@ public struct Command: Hashable { return String(cString: name) } + /// The verbose description provided by the command. + public var verboseDescription: String { + let name = llb_buildsystem_command_get_verbose_description(handle)! + defer { free(name) } + + return String(cString: name) + } + + /// The debug description provides the verbose description. + public var debugDescription: String { + return verboseDescription + } + public var hashValue: Int { return handle!.hashValue }