From 5fa6a0b696974e181094b9bf5345c5dfdd30023e Mon Sep 17 00:00:00 2001 From: Peter van der Zee Date: Mon, 2 Jun 2025 11:04:48 -0500 Subject: [PATCH] Only apply new help layout to root command --- src/utils/meow-with-subcommands.mts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/meow-with-subcommands.mts b/src/utils/meow-with-subcommands.mts index fa4790271..5c9ce4bb1 100644 --- a/src/utils/meow-with-subcommands.mts +++ b/src/utils/meow-with-subcommands.mts @@ -210,8 +210,8 @@ export async function meowWithSubcommands( delete subcommands['report'] } - function formatCommandsForHelp() { - if (!isTestingV1()) { + function formatCommandsForHelp(isRootCommand: boolean) { + if (!isRootCommand || !isTestingV1()) { return getHelpListOutput( { ...toSortedObject( @@ -360,7 +360,7 @@ export async function meowWithSubcommands( $ ${name} ${isRootCommand && isTestingV1() ? '' : ' Commands'} - ${formatCommandsForHelp()} + ${formatCommandsForHelp(isRootCommand)} ${isRootCommand && isTestingV1() ? ' Options' : ' Options'}${isRootCommand ? ' (Note: all CLI commands have these flags even when not displayed in their help)\n' : ''} ${getFlagListOutput(flags, 6, isTestingV1() ? { padName: 25 } : undefined)}