From f16b6dad83cca1346ebbb8986de22de6708fa234 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 27 Jun 2018 16:22:36 +0200 Subject: [PATCH] Added a note about command aliases and services --- console/commands_as_services.rst | 6 ++++++ 1 file changed, 6 insertions(+) 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.