Skip to content

Commit 07ff8f9

Browse files
authored
fix: allow helpCallback to return sections
1 parent 557757c commit 07ff8f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Command.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class Command {
138138
helpCallback
139139
} = this.cli.globalCommand
140140

141-
const sections: HelpSection[] = [
141+
let sections: HelpSection[] = [
142142
{
143143
body: `${name}${versionNumber ? ` v${versionNumber}` : ''}`
144144
}
@@ -218,7 +218,7 @@ class Command {
218218
}
219219

220220
if (helpCallback) {
221-
helpCallback(sections)
221+
sections = helpCallback(sections) || sections
222222
}
223223

224224
console.log(

0 commit comments

Comments
 (0)