From 8a3e823a2e4ed7012d35db882916bab2ad8a080a Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 11 Feb 2020 17:03:26 -0800 Subject: [PATCH] Update ifmain to my standard format. --- voussoirkit/downloady.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/voussoirkit/downloady.py b/voussoirkit/downloady.py index 6c2898c..c95d19a 100644 --- a/voussoirkit/downloady.py +++ b/voussoirkit/downloady.py @@ -443,7 +443,7 @@ def download_argparse(args): break -if __name__ == '__main__': +def main(argv): parser = argparse.ArgumentParser() parser.add_argument('url') @@ -458,5 +458,8 @@ if __name__ == '__main__': parser.add_argument('--no-ssl', dest='no_ssl', action='store_true') parser.set_defaults(func=download_argparse) - args = parser.parse_args() + args = parser.parse_args(argv) return args.func(args) + +if __name__ == '__main__': + raise SystemExit(main(sys.argv[1:]))