diff --git a/config/dist/aliases.yml b/config/dist/aliases.yml index b24f731..e1280a3 100644 --- a/config/dist/aliases.yml +++ b/config/dist/aliases.yml @@ -28,10 +28,14 @@ commands: - uslca user:login:url: - usli + - uli user:password:hash: - usph user:password:reset: - upsr views:disable: - vdi - + cache:rebuild: + - cc + update:execute: + - updb diff --git a/src/Application.php b/src/Application.php index b898b30..72907fc 100644 --- a/src/Application.php +++ b/src/Application.php @@ -115,6 +115,7 @@ public function doRun(InputInterface $input, OutputInterface $output) if ($commandName && !$this->has($commandName)) { + $isValidCommand = false; $config = $configurationManager->getConfiguration(); $mappings = $config ->get('application.commands.mappings'); @@ -129,7 +130,23 @@ public function doRun(InputInterface $input, OutputInterface $output) $this->add( $this->find($commandNameMap)->setAliases([$commandName]) ); - } else { + $isValidCommand = true; + } + + $drushCommand = $configurationManager->readDrushEquivalents($commandName); + if ($drushCommand) { + $this->add( + $this->find($drushCommand)->setAliases([$commandName]) + ); + $isValidCommand = true; + $messages['warning'][] = sprintf( + $this->trans('application.errors.drush-command'), + $commandName, + $drushCommand + ); + } + + if (!$isValidCommand) { $io->error( sprintf( $this->trans('application.errors.invalid-command'),