diff --git a/docs/en/console-commands/commands.md b/docs/en/console-commands/commands.md index 55cb26ebd8..ec3ab845a1 100644 --- a/docs/en/console-commands/commands.md +++ b/docs/en/console-commands/commands.md @@ -37,8 +37,8 @@ class HelloCommand extends Command ``` Command classes must implement an `execute()` method that does the bulk of -their work. This method is called when a command is invoked. Let's call our first -command application directory, run: +their work. This method is called when a command is invoked. Let's call our +first command. From your application directory, run: ```bash bin/cake hello @@ -48,6 +48,16 @@ You should see the following output: Hello world. +::: info +The `Arguments` and `ConsoleIo` instances passed to `execute()` are also +available on the command instance as `$this->args` and `$this->io`. +In 6.x, the `execute()` method signature will drop these arguments +and `$this->args` / `$this->io` will be the only way to access +these objects. See the +[6.x command refactor](https://github.com/cakephp/cakephp/pull/18983) for +details. +::: + Our `execute()` method isn't very interesting let's read some input from the command line: