1 | #!/usr/bin/env python3 |
2 | # s3-bsync Copyright (c) 2021 Joshua Stockin |
3 | # <https://joshstock.in> |
4 | # <https://git.joshstock.in/s3-bsync> |
5 | # |
6 | # This software is licensed and distributed under the terms of the MIT License. |
7 | # See the MIT License in the LICENSE file of this project's root folder. |
8 | # |
9 | # This comment block and its contents, including this disclaimer, MUST be |
10 | # preserved in all copies or distributions of this software's source. |
11 |
|
12 | import sys |
13 |
|
14 | import logging |
15 |
|
16 | import pprint |
17 |
|
18 | import s3_bsync |
19 |
|
20 | logger = logging.getLogger(__name__) |
21 |
|
22 |
|
23 | def main(): |
24 | args = s3_bsync.command_parse.command_parse(sys.argv[1:]) |
25 |
|
26 | logLevel = logging.INFO |
27 | if args.debug: |
28 | logLevel = logging.DEBUG |
29 |
|
30 | logging.basicConfig( |
31 | format="\x1b[0;37m[ \x1b[0;35m%(relativeCreated)04d \x1b[0;37m/ \x1b[0;33m%(name)s\x1b[0;37m:\x1b[1;36m%(funcName)s \x1b[0;37m/ \x1b[0;34m%(levelname)s \x1b[0;37m] \x1b[0m%(message)s", |
32 | datefmt="%H:%M:%S", |
33 | level=logLevel, |
34 | ) |
35 |
|
36 | logger.debug(f"Parsed input arguments:\n{pprint.pformat(vars(args))}") |
37 | logger.debug("Sanitizing input arguments") |
38 | args = s3_bsync.command_parse.sanitize_arguments(args) |
39 |
|
40 | return 0 |
41 |
|
42 |
|
43 | if __name__ == "__main__": |
44 | sys.exit(main() or 0) |
45 |
|