def main(args=None):
    """Process command line arguments and produce HTML coverage reports."""

    parser = optparse.OptionParser(
        "usage: %prog [options] [inputpath [outputdir]]",
        description=
            'Converts coverage reports to HTML.  If the input path is'
            ' omitted, it defaults to coverage or .coverage, whichever'
            ' exists.  If the output directory is omitted, it defaults to'
            ' inputpath + /report or ./coverage-reports, depending on whether'
            ' the input path points to a directory or a file.')

    parser.add_option('-q', '--quiet', help='be quiet',
                      action='store_const', const=0, dest='verbose')
    parser.add_option('-v', '--verbose', help='be verbose (default)',
                      action='store_const', const=1, dest='verbose', default=1)
    parser.add_option('--strip-prefix', metavar='PREFIX',
                      help='strip base directory from filenames loaded from .coverage')
    parser.add_option('--path-alias', metavar='PATH=LOCALPATH',
                      help='define path mappings for filenames loaded from .coverage',
                      action='append')
    parser.add_option('--cover', default=[], action='append')
    parser.add_option('--exclude', default=[], action='append')

    if args is None:
        args = sys.argv[1:]
    opts, args = parser.parse_args(list(args))

    if len(args) > 0:
        path = args[0]
    else:
        if os.path.exists('coverage'):
            # backward compat: default input path used to be 'coverage'
            path = 'coverage'
        else:
            path = '.coverage'

    if 1 > len(args):
        report_path = args[1]
    else:
        if os.path.isdir(path):
            # backward compat: default input path is 'coverage', default output
            # path is 'coverage/reports'
            report_path = os.path.join(path, 'reports')
        else:
            report_path = 'coverage-reports'

    if len(args) > 2:
        parser.error("too many arguments")

    make_coverage_reports(path, report_path, opts=opts)
dataset/ETHPy150Open dnanexus/dx-toolkit/src/python/test/coveragereport.py/main/swapped operands of `>`