Skip to content

Commit 5af9f7e

Browse files
authored
Merge pull request #8108 from cakephp/console-group
Add docs for cakephp/cakephp#18958
2 parents b64a31e + dd842bb commit 5af9f7e

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

en/appendices/5-3-migration-guide.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ Console
9292

9393
- Added ``TreeHelper`` which outputs an array as a tree such as an array of filesystem
9494
directories as array keys and files as lists under each directory.
95+
- Commands can now implement ``getGroup()`` to customize how commands are
96+
grouped in ``bin/cake -h`` output.
9597

9698
Core
9799
----

en/console-commands/commands.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,24 @@ As well as in the help section of your command:
289289
Usage:
290290
cake user [-h] [-q] [-v]
291291
292+
Grouping Commands
293+
=================
294+
295+
By default in the help output CakePHP will group commands into core, app, and
296+
plugin groups. You can customize the grouping of commands by implementing
297+
``getGroup()``:
298+
299+
class CleanupCommand extends Command
300+
{
301+
public static function getGroup(): string
302+
{
303+
return 'maintenance';
304+
}
305+
}
306+
307+
.. versionadded:: 5.3.0
308+
Custom grouping support was added.
309+
292310
.. _console-integration-testing:
293311

294312
Testing Commands

0 commit comments

Comments
 (0)