1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-17 17:08:37 +00:00

Enhance option in command

This commit is contained in:
Nicolas Lœuillet 2016-04-28 13:41:36 +02:00
parent 3fad6c74fe
commit 235026e2c7
3 changed files with 6 additions and 8 deletions

View file

@ -18,7 +18,7 @@ class ImportCommand extends ContainerAwareCommand
->addArgument('userId', InputArgument::REQUIRED, 'User ID to populate')
->addArgument('filepath', InputArgument::REQUIRED, 'Path to the JSON file')
->addOption('importer', null, InputArgument::OPTIONAL, 'The importer to use: v1 or v2', 'v1')
->addOption('markAsRead', null, InputArgument::OPTIONAL, 'Mark all entries as read: true/false', false)
->addOption('markAsRead', null, InputArgument::OPTIONAL, 'Mark all entries as read', false)
;
}
@ -42,9 +42,7 @@ class ImportCommand extends ContainerAwareCommand
$wallabag = $this->getContainer()->get('wallabag_import.wallabag_v2.import');
}
if ('yes' === $input->getOption('markAsRead')) {
$wallabag->setMarkAsRead(true);
}
$wallabag->setMarkAsRead($input->getOption('markAsRead'));
$res = $wallabag
->setUser($user)