diff --git a/console/commands_as_services.rst b/console/commands_as_services.rst index a5533ef3b82..d1259364aaa 100644 --- a/console/commands_as_services.rst +++ b/console/commands_as_services.rst @@ -128,6 +128,12 @@ Or set the ``command`` attribute on the ``console.command`` tag in your service ->addTag('console.command', array('command' => 'app:sunshine')) ; +.. note:: + + If the command defines aliases (using the + :method:`Symfony\\Component\\Console\\Command\\Command::getAliases` method) + you must add one ``console.command`` tag per alias. + That's it. One way or another, the ``SunshineCommand`` will be instantiated only when the ``app:sunshine`` command is actually called.