feat: Begins vault commands, adds nodes for rendering discussion documentation.
This commit is contained in:
57
Sources/hpa/Internal/GlobalOptions.swift
Normal file
57
Sources/hpa/Internal/GlobalOptions.swift
Normal file
@@ -0,0 +1,57 @@
|
||||
import ArgumentParser
|
||||
|
||||
struct BasicGlobalOptions: ParsableArguments {
|
||||
@Flag(
|
||||
name: .shortAndLong,
|
||||
help: "Increase logging level (can be passed multiple times)."
|
||||
)
|
||||
var verbose: Int
|
||||
|
||||
@Flag(
|
||||
name: .shortAndLong,
|
||||
help: "Supress logging."
|
||||
)
|
||||
var quiet = false
|
||||
|
||||
@Option(
|
||||
name: .shortAndLong,
|
||||
help: "Optional shell to use when calling shell commands.",
|
||||
completion: .file()
|
||||
)
|
||||
var shell: String?
|
||||
|
||||
}
|
||||
|
||||
@dynamicMemberLookup
|
||||
struct GlobalOptions: ParsableArguments {
|
||||
|
||||
@Option(
|
||||
name: .shortAndLong,
|
||||
help: "Optional path to the ansible hpa playbook directory."
|
||||
)
|
||||
var playbookDir: String?
|
||||
|
||||
@Option(
|
||||
name: .shortAndLong,
|
||||
help: "Optional path to the ansible inventory to use."
|
||||
)
|
||||
var inventoryPath: String?
|
||||
|
||||
@Flag(
|
||||
name: .long,
|
||||
help: "Supress only playbook logging."
|
||||
)
|
||||
var quietOnlyPlaybook = false
|
||||
|
||||
@OptionGroup var basic: BasicGlobalOptions
|
||||
|
||||
subscript<T>(dynamicMember keyPath: WritableKeyPath<BasicGlobalOptions, T>) -> T {
|
||||
get { basic[keyPath: keyPath] }
|
||||
set { basic[keyPath: keyPath] = newValue }
|
||||
}
|
||||
|
||||
subscript<T>(dynamicMember keyPath: KeyPath<BasicGlobalOptions, T>) -> T {
|
||||
basic[keyPath: keyPath]
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user