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 s3_bsync |
17 |
|
18 | logger = logging.getLogger(__name__) |
19 |
|
20 |
|
21 | def main(): |
22 | args = s3_bsync.command_parse.command_parse(sys.argv[1:]) |
23 |
|
24 | logLevel = logging.INFO |
25 | if args.debug: |
26 | logLevel = logging.DEBUG |
27 |
|
28 | logging.basicConfig( |
29 | 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", |
30 | datefmt="%H:%M:%S", |
31 | level=logLevel, |
32 | ) |
33 |
|
34 | logger.debug(f"Parsed input arguments: {vars(args)}") |
35 | logger.debug("Sanitizing input arguments") |
36 | args = s3_bsync.command_parse.sanitize_arguments(args) |
37 |
|
38 | return 0 |
39 |
|
40 |
|
41 | if __name__ == "__main__": |
42 | sys.exit(main() or 0) |
43 |
|