Skip to content

Commit 0d0d2ec

Browse files
authored
feat(usage): resolve sub commands for meta description (#32)
1 parent 1b57ba3 commit 0d0d2ec

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/usage.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@ export async function renderUsage<T extends ArgsDef = ArgsDef>(
6666

6767
if (cmd.subCommands) {
6868
const commandNames: string[] = [];
69-
for (const [name, sub] of Object.entries(cmd.subCommands)) {
70-
commandsLines.push([name, sub.meta?.description || ""]);
69+
const subCommands = await resolveValue(cmd.subCommands);
70+
for (const [name, sub] of Object.entries(subCommands)) {
71+
const subCmd = await resolveValue(sub);
72+
const meta = await resolveValue(subCmd?.meta);
73+
commandsLines.push([name, meta?.description || ""]);
7174
commandNames.push(name);
7275
}
7376
usageLine.push(commandNames.join("|"));

0 commit comments

Comments
 (0)