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

Commit 27b4726

Browse files
committed
Fixed identify command
1 parent 01917fc commit 27b4726

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Elgentos/Masquerade/Console/IdentifyCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
134134
foreach ($candidates as $candidate) {
135135
list($table, $column, $formatter, $examples) = $candidate;
136136
$helper = $this->getHelper('question');
137+
$default = true;
137138
if (empty($examples)) {
138139
$examples = 'None';
140+
$default = false;
139141
}
140-
$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);
142+
$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);
141143

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

0 commit comments

Comments
 (0)