diff --git a/components/console/single_command_tool.rst b/components/console/single_command_tool.rst index 462408a4e2a..e25bd7f0390 100644 --- a/components/console/single_command_tool.rst +++ b/components/console/single_command_tool.rst @@ -41,21 +41,17 @@ Of course, you can still register a command as usual:: require __DIR__.'/vendor/autoload.php'; use Symfony\Component\Console\Application; - use Symfony\Component\Console\Input\InputArgument; - use Symfony\Component\Console\Input\InputInterface; - use Symfony\Component\Console\Input\InputOption; - use Symfony\Component\Console\Output\OutputInterface; - + use Acme\Command\DefaultCommand; - + $application = new Application('echo', '1.0.0'); $command = new DefaultCommand(); - + $application->add($command); - - $application->setDefaultCommand($command, true); + + $application->setDefaultCommand($command->getName(), true); $application->run(); - + .. tip:: You don't need to pass the command name in order to get the help.