<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def main(argv=None):
 """Commandline script wrapping Baker."""

    parser = argparse.ArgumentParser(description="Process raw HTML to baked"
                                                 " (embedded numbering and"
                                                 " collation)")
    parser.add_argument('-v', '--version', action="version",
                        version=__version__, help='Report the library version')
    parser.add_argument("css_rules",
                        type=argparse.FileType('rb'),
                        help="CSS3 ruleset stylesheet recipe")
    parser.add_argument("html_in", nargs="?",
                        type=argparse.FileType('r'),
                        help="raw HTML file to bake (default stdin)",
                        default=sys.stdin)
    parser.add_argument("html_out", nargs="?",
                        type=argparse.FileType('w'),
                        help="baked HTML file output (default stdout)",
                        default=sys.stdout)
    parser.add_argument('-s', '--stop-at', action='store', metavar='<pass>',
                        help='Stop baking just before given pass name')
    parser.add_argument('-d', '--debug', action='store_true',
                        help='Send debugging info to stderr')
    parser.add_argument('-q', '--quiet', action='store_true',
                        help="Quiet all on stderr except errors")
    parser.add_argument('-c', '--coverage-file', metavar='coverage.lcov',
                        type=FileTypeExt('w'),
                        help="output coverage file (lcov format). If "
                        "filename starts with '+', append coverage info.")
    parser.add_argument('--use-repeatable-ids', action='store_true',
                        help="use repeatable id attributes instead of uuids "
                        "which is useful for diffing")
    args = parser.parse_args(argv)

    formatter = logging.Formatter('%(name)s %(levelname)s %(message)s')
    handler = logging.StreamHandler(sys.stderr)
    handler.setFormatter(formatter)
    logger.addHandler(handler)

    use_quiet_log = (args.quiet and logging.ERROR)
    use_debug_log = (args.debug and logging.DEBUG)

    # Debug option takes higher priority than quiet warnings option
    logger.setLevel(use_debug_log or use_quiet_log or logging.WARNING)

    try:
        easybake(args.css_rules, args.html_in, args.html_out, args.stop_at,
                 args.coverage_file, args.use_repeatable_ids)
    finally:
        if args.css_rules:
            args.css_rules.close()
        if args.html_in:
            args.html_in.close()
        if args.html_out:
            args.html_out.close()
        if args.coverage_file:
            args.coverage_file.close()