feat: Updates 'extraArgs' naming to 'extraOptions' as it's more inline with the usage of them

This commit is contained in:
2024-12-12 18:21:13 -05:00
parent bd56660683
commit ba1e61d99e
7 changed files with 43 additions and 22 deletions

View File

@@ -25,7 +25,13 @@ func createAbstract(_ string: String) -> String {
extension Usage where Content == AnyTextNode {
static func `default`(commandName: String, parentCommand: String?) -> Self {
static func `default`(
commandName: String,
parentCommand: String?,
usesArguments: Bool = true,
usesOptions: Bool = true,
usesExtraArguments: Bool = true
) -> Self {
.init {
HStack {
HStack {
@@ -37,10 +43,16 @@ extension Usage where Content == AnyTextNode {
}
.color(.blue).bold()
"[OPTIONS]".color(.green)
"[ARGUMENTS]".color(.cyan)
"--"
"[EXTRA-OPTIONS]".color(.magenta)
if usesOptions {
"[OPTIONS]".color(.green)
}
if usesArguments {
"[ARGUMENTS]".color(.cyan)
}
if usesExtraArguments {
"--"
"[EXTRA-OPTIONS]".color(.magenta)
}
}
.eraseToAnyTextNode()