MCPcopy
hub / github.com/freedomofpress/dangerzone / parse_args

Function parse_args

dev_scripts/qa.py:1001–1045  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

999
1000
1001def parse_args():
1002 parser = argparse.ArgumentParser(
1003 prog=sys.argv[0],
1004 description="Run QA tests for a platform",
1005 )
1006 parser.add_argument(
1007 "platform",
1008 choices=sorted(QABase.platforms.keys()),
1009 help="Run QA tests for the provided platform",
1010 nargs="?",
1011 )
1012 parser.add_argument(
1013 "--try-auto",
1014 action="store_true",
1015 default=False,
1016 help="Try to run the automated parts of the QA steps",
1017 )
1018 # FIXME: Find a better way to skip tasks in non-interactive environments, while
1019 # retaining the ability to be semi-prompted in interactive environments.
1020 parser.add_argument(
1021 "--skip-manual",
1022 action="store_true",
1023 default=False,
1024 help="Skip the manual parts of the QA steps",
1025 )
1026 parser.add_argument(
1027 "--debug",
1028 action="store_true",
1029 default=False,
1030 help="Enable debug logs",
1031 )
1032 parser.add_argument(
1033 "--check-refs",
1034 action="store_true",
1035 default=False,
1036 help="Check if references to docs still hold",
1037 )
1038
1039 args = parser.parse_args()
1040
1041 if not args.check_refs and not args.platform:
1042 parser.print_help(sys.stderr)
1043 sys.exit(1)
1044
1045 return args
1046
1047
1048def setup_logging(debug=False):

Callers 1

mainFunction · 0.70

Calls 1

exitMethod · 0.80

Tested by

no test coverage detected