Skip to content

Commit

Permalink
Fix cli info format
Browse files Browse the repository at this point in the history
Currently the convert script always displays the total number of formats
it is able to export to, no matter how many of which have actually been
selected:
```
Converted data for 250 countries into 5 formats.
```
This is now fixed. Calling the convert script with, say, `-f csv` it now
displays `[...] into 1 format.`
  • Loading branch information
jonas-schulze authored and mledoze committed Mar 7, 2018
1 parent 65b9940 commit 0a30fc8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/MLD/Console/Command/ExportCommand.php
Expand Up @@ -120,7 +120,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
->save($c['output_file']);
}

$output->writeln('Converted data for <info>' . count($countries) . '</info> countries into <info>' . count($this->converters) . '</info> formats.');
$count = count($formats);
$output->writeln('Converted data for <info>' . count($countries) . '</info> countries into <info>' . $count . '</info> ' . ($count == 1 ? 'format.' : 'formats.'));
}

/**
Expand Down

0 comments on commit 0a30fc8

Please sign in to comment.