Skip to content

Commit 0d7514c

Browse files
committed
Document that usages may be supplied by AsCommand Attribute
1 parent 6b6a678 commit 0d7514c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

console.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,13 @@ If you can't use PHP attributes, register the command as a service and
147147
:ref:`default services.yaml configuration <service-container-services-load-example>`,
148148
this is already done for you, thanks to :ref:`autoconfiguration <services-autoconfigure>`.
149149

150-
You can also use ``#[AsCommand]`` to add a description and longer help text for the command::
150+
You can also use ``#[AsCommand]`` to add a description, usages, and longer help text for the command::
151151

152152
#[AsCommand(
153153
name: 'app:create-user',
154154
description: 'Creates a new user.', // the command description shown when running "php bin/console list"
155155
help: 'This command allows you to create a user...', // the command help shown when running the command with the "--help" option
156+
usages: ['app:create-user alice'],
156157
)]
157158
class CreateUserCommand
158159
{

0 commit comments

Comments
 (0)