Skip to content

Commit e9cf93b

Browse files
authored
Only apply new help layout to root command (#628)
1 parent 21a7042 commit e9cf93b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils/meow-with-subcommands.mts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ export async function meowWithSubcommands(
210210
delete subcommands['report']
211211
}
212212

213-
function formatCommandsForHelp() {
214-
if (!isTestingV1()) {
213+
function formatCommandsForHelp(isRootCommand: boolean) {
214+
if (!isRootCommand || !isTestingV1()) {
215215
return getHelpListOutput(
216216
{
217217
...toSortedObject(
@@ -360,7 +360,7 @@ export async function meowWithSubcommands(
360360
$ ${name} <command>
361361
362362
${isRootCommand && isTestingV1() ? '' : ' Commands'}
363-
${formatCommandsForHelp()}
363+
${formatCommandsForHelp(isRootCommand)}
364364
365365
${isRootCommand && isTestingV1() ? ' Options' : ' Options'}${isRootCommand ? ' (Note: all CLI commands have these flags even when not displayed in their help)\n' : ''}
366366
${getFlagListOutput(flags, 6, isTestingV1() ? { padName: 25 } : undefined)}

0 commit comments

Comments
 (0)