Skip to content

Commit 03c597a

Browse files
committedJan 31, 2024
fix: dont indent when no shor char
1 parent 3cb3373 commit 03c597a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/help/command.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class CommandHelp extends HelpFormatter {
161161
}
162162
}
163163

164-
label = labels.join(colorize(this.config?.theme?.flagSeparator, flag.char ? ', ' : ' '))
164+
label = labels.join(flag.char ? colorize(this.config?.theme?.flagSeparator, ', ') : ' ')
165165
}
166166

167167
if (flag.type === 'option') {
@@ -175,7 +175,7 @@ export class CommandHelp extends HelpFormatter {
175175
label += `=${value}`
176176
}
177177

178-
return label
178+
return colorize(this.config.theme?.flag, label)
179179
}
180180

181181
protected flags(flags: Array<Command.Flag.Any>): [string, string | undefined][] | undefined {
@@ -184,7 +184,7 @@ export class CommandHelp extends HelpFormatter {
184184
const noChar = flags.reduce((previous, current) => previous && current.char === undefined, true)
185185

186186
return flags.map((flag) => {
187-
let left = colorize(this.config?.theme?.flag, this.flagHelpLabel(flag))
187+
let left = this.flagHelpLabel(flag)
188188

189189
if (noChar) left = left.replace(' ', '')
190190

0 commit comments

Comments
 (0)
Please sign in to comment.