From b89aafc8ffa39b9184557bacc4c7548a5bda9b3d Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Thu, 22 Dec 2016 16:57:39 +0100 Subject: lesana index: allow to index a limited number of files --- lesana/command.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lesana/command.py b/lesana/command.py index 25a422a..2f24fa0 100644 --- a/lesana/command.py +++ b/lesana/command.py @@ -39,9 +39,18 @@ class Index(gadona.Command): (['--collection', '-c'], dict( help='The collection to work on (default .)' )), + (['files'], dict( + help='List of files to index (default: everything)', + default=None, + nargs='*' + )), ] def main(self): collection = Collection(self.settings.collection) - indexed = collection.update_cache() + if self.settings.files: + files = (os.path.basename(f) for f in self.settings.files) + else: + files = None + indexed = collection.update_cache(fnames=files) print("Found and indexed {} entries".format(indexed)) -- cgit v1.2.3