Conditions | 3 |
Total Lines | 30 |
Code Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | # Copyright Pincer 2021-Present |
||
41 | def main(): |
||
42 | parser = argparse.ArgumentParser( |
||
43 | description='Download rendered mermaid files.' |
||
44 | ) |
||
45 | parser.add_argument( |
||
46 | '--file', |
||
47 | type=str, |
||
48 | nargs='?', |
||
49 | help='A file to download. If not specified all files are downloaded.', |
||
50 | default=None |
||
51 | ) |
||
52 | parser.add_argument( |
||
53 | '--dir', |
||
54 | type=str, |
||
55 | nargs='?', |
||
56 | help='Directory to search. Does not work with --file.', |
||
57 | default=None |
||
58 | ) |
||
59 | |||
60 | args = parser.parse_args() |
||
61 | |||
62 | if "help" in args: |
||
63 | print(args) |
||
64 | return |
||
65 | |||
66 | if args.file: |
||
67 | asyncio.run(download_file(args.file)) |
||
68 | return |
||
69 | |||
70 | asyncio.run(download_all(args.dir)) |
||
71 | |||
75 |