summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2016-12-22 16:57:39 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2016-12-22 16:57:39 +0100
commitb89aafc8ffa39b9184557bacc4c7548a5bda9b3d (patch)
tree41ba07795cba2be161ef920ba11bdd9a3cbb1968
parent6f9eaac83999fc8f6ba513b3705f6717b0f6fed8 (diff)
lesana index: allow to index a limited number of files
-rw-r--r--lesana/command.py11
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))