Verified Commit 72e79e84 authored by anarcat's avatar anarcat
Browse files

move args interpretation back into argument parser

This is the proper place to this level of abstraction, i think.
parent 9b3f09a5
......@@ -102,6 +102,13 @@ class BatchArgParser(argparse.ArgumentParser):
default=os.environ.get("WEBDAV_PASSWORD"),
)
def parse_args(self, *args, **kwargs):
args = super().parse_args(*args, **kwargs)
if args.password is None:
args.password = input("Password:")
return args
class Sanitizer:
"""actually sanitize files with Docker
......@@ -308,8 +315,6 @@ def is_special_folder(folder: str) -> bool:
def main():
logging.basicConfig(format="%(message)s")
args = BatchArgParser().parse_args()
if args.password is None:
args.password = input("Password:")
options = {
"webdav_hostname": args.location,
"webdav_login": args.username,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment