8000 Added a note about command aliases and services · symfony/symfony-docs@f16b6da · GitHub
[go: up one dir, main page]

Skip to content

Commit f16b6da

Browse files
committed
Added a note about command aliases and services
1 parent 177c84a commit f16b6da

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

console/commands_as_services.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ Or set the ``command`` attribute on the ``console.command`` tag in your service
128128
->addTag('console.command', array('command' => 'app:sunshine'))
129129
;
130130
131+
.. note::
132+
133+
If the command defines aliases (using the
134+
:method:`Symfony\\Component\\Console\\Command\\Command::getAliases` method)
135+
you must add one ``console.command`` tag per alias.
136+
131137
That's it. One way or another, the ``SunshineCommand`` will be instantiated
132138
only when the ``app:sunshine`` command is actually called.
133139

0 commit comments

Comments
 (0)
0