feat: Let occ deck:import default to deck json importer
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -25,6 +25,7 @@ namespace OCA\Deck\Command;
|
||||
|
||||
use OCA\Deck\Service\Importer\BoardImportCommandService;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
@@ -41,7 +42,9 @@ class BoardImport extends Command {
|
||||
*/
|
||||
protected function configure() {
|
||||
$allowedSystems = $this->boardImportCommandService->getAllowedImportSystems();
|
||||
$names = array_column($allowedSystems, 'name');
|
||||
$names = array_map(function ($name) {
|
||||
return '"' . $name . '"';
|
||||
}, array_column($allowedSystems, 'internalName'));
|
||||
$this
|
||||
->setName('deck:import')
|
||||
->setDescription('Import data')
|
||||
@@ -50,7 +53,7 @@ class BoardImport extends Command {
|
||||
null,
|
||||
InputOption::VALUE_REQUIRED,
|
||||
'Source system for import. Available options: ' . implode(', ', $names) . '.',
|
||||
null
|
||||
'DeckJson',
|
||||
)
|
||||
->addOption(
|
||||
'config',
|
||||
@@ -66,6 +69,11 @@ class BoardImport extends Command {
|
||||
'Data file to import.',
|
||||
'data.json'
|
||||
)
|
||||
->addArgument(
|
||||
'file',
|
||||
InputArgument::OPTIONAL,
|
||||
'File to import',
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user