diff --git a/en/appendices/5-3-migration-guide.rst b/en/appendices/5-3-migration-guide.rst index 25dba3c845..8598a8039b 100644 --- a/en/appendices/5-3-migration-guide.rst +++ b/en/appendices/5-3-migration-guide.rst @@ -92,6 +92,8 @@ Console - Added ``TreeHelper`` which outputs an array as a tree such as an array of filesystem directories as array keys and files as lists under each directory. +- Commands can now implement ``getGroup()`` to customize how commands are + grouped in ``bin/cake -h`` output. Core ---- diff --git a/en/console-commands/commands.rst b/en/console-commands/commands.rst index 797c69a337..07a30ca735 100644 --- a/en/console-commands/commands.rst +++ b/en/console-commands/commands.rst @@ -289,6 +289,24 @@ As well as in the help section of your command: Usage: cake user [-h] [-q] [-v] +Grouping Commands +================= + +By default in the help output CakePHP will group commands into core, app, and +plugin groups. You can customize the grouping of commands by implementing +``getGroup()``: + + class CleanupCommand extends Command + { + public static function getGroup(): string + { + return 'maintenance'; + } + } + +.. versionadded:: 5.3.0 + Custom grouping support was added. + .. _console-integration-testing: Testing Commands