diff --git a/Command/Proxy/RunSqlDoctrineCommand.php b/Command/Proxy/RunSqlDoctrineCommand.php index edcc7828f..ff6c3b078 100644 --- a/Command/Proxy/RunSqlDoctrineCommand.php +++ b/Command/Proxy/RunSqlDoctrineCommand.php @@ -21,7 +21,6 @@ protected function configure() $this ->setName('doctrine:query:sql') - ->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command') ->setHelp(<<%command.name% command executes the given SQL query and outputs the results: @@ -29,6 +28,12 @@ protected function configure() php %command.full_name% "SELECT * FROM users" EOT ); + + if ($this->getDefinition()->hasOption('connection')) { + return; + } + + $this->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command'); } /**