diff options
author | Anthony Wang | 2022-01-22 21:42:27 -0600 |
---|---|---|
committer | Anthony Wang | 2022-01-22 21:42:27 -0600 |
commit | 70bd8774d1c174208e635df70b9046e7442d0a6b (patch) | |
tree | 5aade90e70e19752eac2292bd9902464b1deaf9b | |
parent | f02bfd943a34a544c5a1556e7821f19859679f45 (diff) |
Clean up mkbinder arg parser
-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() |