def METHOD_NAME(argv):
    try:
        opts, arg = getopt.getopt(sys.argv[1:], "h")
        for opt in opts:
            if opt[0] == '-h':
                usage()
                sys.exit()
    except getopt.GetoptError:
        usage()
        sys.exit(1)
    try:
        formats = read_format(arg[0])
        fd = open(arg[1], 'rb')
    except IOError:
        sys.exit(1)
    main_loop(formats, fd)