Skip to content

Commit

Permalink
Allow commands to display help information on their own
Browse files Browse the repository at this point in the history
Closes gh-763
  • Loading branch information
rainboyan committed Nov 28, 2024
1 parent f6430f3 commit 5c3554b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class GrailsCli {
exit(0)
}

if (mainCommandLine.hasOption(CommandLine.HELP_ARGUMENT) || mainCommandLine.hasOption('h')) {
if (!mainCommandLine.commandName && (mainCommandLine.hasOption(CommandLine.HELP_ARGUMENT) || mainCommandLine.hasOption('h'))) {
profileRepository = createMavenProfileRepository()
Command cmd = CommandRegistry.getCommand('help', profileRepository)
cmd.handle(createExecutionContext(mainCommandLine))
Expand Down

0 comments on commit 5c3554b

Please sign in to comment.