Skip to content

Commit 17a2e87

Browse files
authored
fix(AppCommandHandler): use unique identifier for uncategorized commands
1 parent 443685c commit 17a2e87

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

β€Žpackages/commandkit/src/app/handlers/AppCommandHandler.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,11 @@ export class AppCommandHandler {
109109
}
110110

111111
public printBanner() {
112+
const uncategorized = crypto.randomUUID();
112113
// Group commands by category
113114
const categorizedCommands = this.getCommandsArray().reduce(
114115
(acc, cmd) => {
115-
const category = cmd.command.category || 'uncategorized';
116+
const category = cmd.command.category || uncategorized;
116117
acc[category] = acc[category] || [];
117118
acc[category].push(cmd);
118119
return acc;
@@ -136,15 +137,15 @@ export class AppCommandHandler {
136137
const categoryPrefix = isLastCategory ? '└─' : 'β”œβ”€';
137138

138139
// Print category header (skip for uncategorized)
139-
if (category !== 'uncategorized') {
140+
if (category !== uncategorized) {
140141
console.log(colors.cyan(`${categoryPrefix} ${colors.bold(category)}`));
141142
}
142143

143144
// Print commands in this category
144145
commands.forEach((cmd, cmdIndex) => {
145146
const isLastCommand = cmdIndex === commands.length - 1;
146147
const commandPrefix =
147-
category !== 'uncategorized'
148+
category !== uncategorized
148149
? (isLastCategory ? ' ' : 'β”‚ ') + (isLastCommand ? '└─' : 'β”œβ”€')
149150
: isLastCommand
150151
? '└─'

0 commit comments

Comments
Β (0)