Make database name question more specific
This commit is contained in:
@ -12,7 +12,7 @@ trait SelectDatabaseQuestion
|
||||
{
|
||||
$question = $this->getHelper('question');
|
||||
|
||||
if (!$name = $input->getArgument('name')) {
|
||||
if (!$name = $input->getArgument('database')) {
|
||||
$selectQuestion = new ChoiceQuestion('Database name: ', $this->db->listDatabases());
|
||||
$name = $question->ask($input, $output, $selectQuestion);
|
||||
}
|
||||
|
22
src/Service/Traits/SelectUserQuestion.php
Normal file
22
src/Service/Traits/SelectUserQuestion.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service\Traits;
|
||||
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Question\ChoiceQuestion;
|
||||
|
||||
trait SelectUserQuestion
|
||||
{
|
||||
private function getUserName(InputInterface $input, OutputInterface $output): string
|
||||
{
|
||||
$question = $this->getHelper('question');
|
||||
|
||||
if (!$name = $input->getArgument('name')) {
|
||||
$selectQuestion = new ChoiceQuestion('Database name: ', $this->db->listDatabases());
|
||||
$name = $question->ask($input, $output, $selectQuestion);
|
||||
}
|
||||
|
||||
return $name;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user