Skip to content

Commit

Permalink
fix: dont indent when no shor char
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Jan 31, 2024
1 parent 3cb3373 commit 03c597a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/help/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class CommandHelp extends HelpFormatter {
}
}

label = labels.join(colorize(this.config?.theme?.flagSeparator, flag.char ? ', ' : ' '))
label = labels.join(flag.char ? colorize(this.config?.theme?.flagSeparator, ', ') : ' ')
}

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

return label
return colorize(this.config.theme?.flag, label)
}

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

return flags.map((flag) => {
let left = colorize(this.config?.theme?.flag, this.flagHelpLabel(flag))
let left = this.flagHelpLabel(flag)

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

Expand Down

0 comments on commit 03c597a

Please sign in to comment.