Skip to content

Commit

Permalink
Alias and tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Luc45 committed Feb 22, 2024
1 parent c12e4a3 commit bc6f733
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/src/Commands/Backend/SwitchBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ public function __construct( ManagerBackend $manager_backend ) {
protected function configure() {
$this
->setDescription( 'Switch to another Manager Backend.' )
->addArgument( 'backend', InputArgument::OPTIONAL, '(Optional) The backend to switch to.' );
->addArgument( 'backend', InputArgument::OPTIONAL, '(Optional) The backend to switch to.' )
->setAliases( [ 'switch' ] );
}

protected function execute( InputInterface $input, OutputInterface $output ): int {
// Optionaly allow the environment to be passed as an argument.
if ( ! empty( $input->getArgument( 'backend' ) ) ) {
$this->manager_backend->switch_to_manager_backend( strtolower( $input->getArgument( 'backend' ) ) );
$output->writeln( sprintf( '<info>Manager backend switched to %s.</info>', $input->getArgument( 'backend' ) ) );
$output->writeln( sprintf( '<info>Backend switched to "%s".</info>', $input->getArgument( 'backend' ) ) );

return Command::SUCCESS;
}
Expand Down

0 comments on commit bc6f733

Please sign in to comment.