linkcheck: move argparsing to main function

This commit is contained in:
Jörg Thalheim 2024-09-17 10:03:56 +02:00
parent 2d5336d3ed
commit f66c272fc2

View File

@ -121,7 +121,7 @@ Usage: python main.py [action] <inputfile> <outfile>
sys.exit(status) sys.exit(status)
if __name__ == "__main__": def main() -> None:
if len(sys.argv) < 2: if len(sys.argv) < 2:
print_usage(1) print_usage(1)
action = sys.argv[1] action = sys.argv[1]
@ -144,3 +144,7 @@ if __name__ == "__main__":
print_usage(0) print_usage(0)
else: else:
print_usage(1) print_usage(1)
if __name__ == "__main__":
main()