def find_opt_end(options):
    """ Find the end of an option (;) handling escapes. """
    offset = 0
    while True:
        i = options[offset:].find(';')
        if options[offset + i - 1] == '\\':
            offset += 2
        else:
            return offset + i
