Skip to content

Commit

Permalink
[foliasplit] parse query prior to reading files
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Nov 18, 2020
1 parent 3e2b8c4 commit 8e9c7bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions foliatools/foliasplit.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ def main():
if len(args.files) < 1:
print("No files specified. Run with --help for usage info.", file=sys.stderr)

#parse query prior to reading files just to make sure there are no syntax errors
fql.Query("SELECT " + args.query)

for filename in args.files:
doc = folia.Document(file=filename)
for i, childdoc in enumerate(split(doc, args.query, args.batchsize, args.copymetadata, args.submetadata, args.suffixtemplate, args.alterids, args.external, None, args.deep)):
Expand Down

0 comments on commit 8e9c7bd

Please sign in to comment.