def METHOD_NAME(args):
    """
    Parses command line arguments and do the work of the program.
    "args" specifies the program arguments, with args[0] being the executable
    name. The return value should be used as the program's exit code.
    """
    options = parse_args(args) # This holds the nicely-parsed options object
    if options.type in ['sam', 'bam']:
        if not have_pysam:
            raise RuntimeError('pysam needed from SAM/BAM support')
        return filter_sam(options)
    elif options.type == 'json-gam':
        return filter_json_gam(options)