From 0cdb9658b5075ab0a0e01408907cbc4cb05ba18e Mon Sep 17 00:00:00 2001 From: "Tommy D. Rossi" Date: Fri, 23 Jan 2026 20:24:58 +0100 Subject: [PATCH] feat: add Description section for specific command help --- mod.mjs | 2 ++ src/Command.ts | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 mod.mjs diff --git a/mod.mjs b/mod.mjs new file mode 100644 index 00000000..9d0e8943 --- /dev/null +++ b/mod.mjs @@ -0,0 +1,2 @@ +// Deno users should use mod.ts instead +export * from './deno/index.ts' \ No newline at end of file diff --git a/src/Command.ts b/src/Command.ts index 93027972..a2cde14a 100644 --- a/src/Command.ts +++ b/src/Command.ts @@ -149,6 +149,17 @@ class Command { body: ` $ ${name} ${this.usageText || this.rawName}`, }) + // Show full description for specific commands (not global/default) + if (!this.isGlobalCommand && !this.isDefaultCommand && this.description) { + sections.push({ + title: 'Description', + body: this.description + .split('\n') + .map((line) => ` ${line}`) + .join('\n'), + }) + } + const showCommands = (this.isGlobalCommand || this.isDefaultCommand) && commands.length > 0