From 235026e2c708eea306a12f1cc1de3da38593db37 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 28 Apr 2016 13:41:36 +0200 Subject: [PATCH] Enhance option in command --- docs/en/user/migration.rst | 2 +- docs/fr/user/migration.rst | 6 +++--- src/Wallabag/ImportBundle/Command/ImportCommand.php | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/en/user/migration.rst b/docs/en/user/migration.rst index cfbca922..42062796 100644 --- a/docs/en/user/migration.rst +++ b/docs/en/user/migration.rst @@ -52,7 +52,7 @@ Please replace values: * ``1`` is the user identifier in database (The ID of the first user created on wallabag is 1) * ``~/Downloads/wallabag-export-1-2016-04-05.json`` is the path of your wallabag v1 export -If you want to mark all these entries as read, you can add the ``--markAsRead=yes`` option. +If you want to mark all these entries as read, you can add the ``--markAsRead`` option. To import a wallabag v2 file, you need to add the option ``--importer=v2``. diff --git a/docs/fr/user/migration.rst b/docs/fr/user/migration.rst index a69df295..91f8bab2 100644 --- a/docs/fr/user/migration.rst +++ b/docs/fr/user/migration.rst @@ -38,8 +38,8 @@ Depuis votre nouvelle instance de wallabag, créez votre compte utilisateur puis .. note:: S'il vous arrive des problèmes durant l'export ou l'import, n'hésitez pas à `demander de l'aide `__. -Import via via la ligne de commande (CLI) ------------------------------------------ +Import via la ligne de commande (CLI) +------------------------------------- Si vous avez accès à la ligne de commandes de votre serveur web, vous pouvez exécuter cette commande pour import votre fichier wallabag v1 : @@ -52,7 +52,7 @@ Remplacez les valeurs : * ``1`` est l'identifiant de votre utilisateur en base (l'ID de votre premier utilisateur créé sur wallabag est 1) * ``~/Downloads/wallabag-export-1-2016-04-05.json`` est le chemin de votre export wallabag v1 -Si vous voulez marquer tous ces articles comme lus, vous pouvez ajouter l'option ``--markAsRead=yes``. +Si vous voulez marquer tous ces articles comme lus, vous pouvez ajouter l'option ``--markAsRead``. Pour importer un fichier wallabag v2, vous devez ajouter l'option ``--importer=v2``. diff --git a/src/Wallabag/ImportBundle/Command/ImportCommand.php b/src/Wallabag/ImportBundle/Command/ImportCommand.php index f62176fc..a4aa8531 100644 --- a/src/Wallabag/ImportBundle/Command/ImportCommand.php +++ b/src/Wallabag/ImportBundle/Command/ImportCommand.php @@ -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) -- 2.41.0