@@ -79,19 +79,38 @@ Configuring the Command
7979You can optionally define a description, help message and the
8080:doc: `input options and arguments </console/input >`::
8181
82+ // ...
83+ // the command description shown when running "php bin/console list"
84+ protected static $defaultDescription = 'Creates a new user.';
85+
8286 // ...
8387 protected function configure(): void
8488 {
8589 $this
86- // the short description shown while running "php bin/console list"
87- ->setDescription('Creates a new user.')
90+ // If you don't like using the $defaultDescription static property,
91+ // you can also define the short description using this method:
92+ // ->setDescription('...')
8893
89- // the full command description shown when running the command with
90- // the "--help" option
94+ // the command help shown when running the command with the "--help" option
9195 ->setHelp('This command allows you to create a user...')
9296 ;
9397 }
9498
99+ Defining the ``$defaultDescription `` static property instead of using the
100+ ``setDescription() `` method allows to get the command description without
101+ instantiating its class. This makes the ``php bin/console list `` command run
102+ much faster.
103+
104+ If you want to always run the ``list `` command fast, add the ``--short `` option
105+ to it (``php bin/console list --short ``). This will avoid instantiating command
106+ classes, but it won't show any description for commands that use the
107+ ``setDescription() `` method instead of the static property.
108+
109+ ..versionadded ::5.3
110+
111+ The ``$defaultDescription `` static property and the ``--short `` option
112+ were introduced in Symfony 5.3.
113+
95114The ``configure() `` method is called automatically at the end of the command
96115constructor. If your command defines its own constructor, set the properties
97116first and then call to the parent constructor, to make those properties