2 # -*- coding: utf-8 -*-
10 License: GNU General Public License version 2 or later.
11 Author: Øyvind A. Holm <sunny@sunbase.org>
19 progname = os.path.basename(__file__)
23 def parse_arguments():
24 """Parse command-line arguments.
26 Returns a Namespace object with the arguments as attributes.
28 parser = argparse.ArgumentParser(description="")
34 help="Increase verbosity level. Can be repeated.",
37 "--version", action="store_true", help="Print version information."
39 return parser.parse_args()
46 args: Namespace object with command line arguments as attributes.
48 0 on success, non-zero error code on failure.
53 if __name__ == "__main__":
54 args = parse_arguments()
56 print(f"{progname} {__version__}")
60 level=logging.DEBUG if args.verbose >= 3 else logging.INFO,
61 format=f"{progname}: %(message)s",