diff options
-rw-r--r-- | lesana/command.py | 11 |
1 files changed, 10 insertions, 1 deletions
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)) |