diff options
-rwxr-xr-x | mkbinder.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/mkbinder.py b/mkbinder.py index ff38307..430a7e2 100755 --- a/mkbinder.py +++ b/mkbinder.py @@ -1,18 +1,22 @@ #!/usr/bin/env python3 -import pdfkit -import weasyprint + import re import os -import argparse +from argparse import ArgumentParser import pickle + +# PDF conversion backends +import pdfkit +import weasyprint + from htmldate import find_date from datetime import date # CLI arguments -parser = argparse.ArgumentParser() -parser.add_argument('--backend', '-b', dest = 'backend', help = 'change the download backend; default: pdfkit', default = 'pdfkit', choices = ['pdfkit', 'weasyprint']) -parser.add_argument('--force', '-f', dest = 'force', help = 'force download all links instead of only the ones that need to be updated; default: False', default = False, choices = [False, True]) +parser = ArgumentParser() +parser.add_argument('--backend', '-b', help = 'change the download backend', default = 'pdfkit', choices = ['pdfkit', 'weasyprint']) +parser.add_argument('--force', '-f', help = 'force download all links', action='store_false') args = parser.parse_args() |