def main(argv=None):
parser = build_argparser()<EOL>args = parser.parse_args(argv)<EOL>logging.basicConfig(level=args.loglevel, format="<STR_LIT>")<EOL>check_args(parser, args)<EOL>if args.extract:<EOL><INDENT>marfile = os.path.abspath(args.extract)<EOL>if args.chdir:<EOL><INDENT>os.chdir(args.chdir)<EOL><DEDENT>do_extract(marfile, os.getcwd(), args.compression)<EOL><DEDENT>elif args.verify:<EOL><INDENT>do_verify(args.verify, args.keyfiles)<EOL><DEDENT>elif args.list:<EOL><INDENT>print("<STR_LIT:\n>".join(do_list(args.list)))<EOL><DEDENT>elif args.list_detailed:<EOL><INDENT>print("<STR_LIT:\n>".join(do_list(args.list_detailed, detailed=True)))<EOL><DEDENT>elif args.create:<EOL><INDENT>marfile = os.path.abspath(args.create)<EOL>signing_key, signing_algorithm = get_key_from_cmdline(parser, args)<EOL>if args.chdir:<EOL><INDENT>os.chdir(args.chdir)<EOL><DEDENT>do_create(marfile, args.files, args.compression,<EOL>productversion=args.productversion, channel=args.channel,<EOL>signing_key=signing_key, signing_algorithm=signing_algorithm)<EOL><DEDENT>elif args.hash:<EOL><INDENT>do_hash(args.hash, args.files[<NUM_LIT:0>], args.asn1)<EOL><DEDENT>elif args.add_signature:<EOL><INDENT>do_add_signature(args.add_signature[<NUM_LIT:0>], args.add_signature[<NUM_LIT:1>], args.add_signature[<NUM_LIT:2>])<EOL><DEDENT>else:  <EOL><INDENT>parser.error("<STR_LIT>")<EOL><DEDENT>
Run the main CLI entry point.