Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
Fixed identify command
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjaap committed Nov 27, 2021
1 parent 01917fc commit 27b4726
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Elgentos/Masquerade/Console/IdentifyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
foreach ($candidates as $candidate) {
list($table, $column, $formatter, $examples) = $candidate;
$helper = $this->getHelper('question');
$default = true;
if (empty($examples)) {
$examples = 'None';
$default = false;
}
$question = new ConfirmationQuestion(sprintf("<comment>Example values: %s</comment>\nDo you want to add <options=bold>%s</> with formatter <options=bold>%s</>?</question> <info>[Y/n]</info> ", print_r($examples, true), $table . '.' . $column, $formatter), true);
$question = new ConfirmationQuestion(sprintf("<comment>Example values: %s</comment>\nDo you want to add <options=bold>%s</> with formatter <options=bold>%s</>?</question> <info>%s</info> ", print_r($examples, true), $table . '.' . $column, $formatter, $default ? '[Y/n]' : '[y/N]'), $default);

if ($helper->ask($input, $output, $question)) {
$question = new Question(sprintf('What group do you want to add it to? <info>[%s]</> ', $table), $table);
$group = $helper->ask($input, $output, $question);
$filename = 'src/config/' . $this->platformName . '/' . $group . '.yaml';
$yamls[$filename][$group][$table][$column]['formatter'] = $formatter;
$yamls[$filename][$group][$table]['columns'][$column]['formatter'] = $formatter;
}
}

Expand Down

0 comments on commit 27b4726

Please sign in to comment.