def clean_prefix(x: str, prefix: str) ->str:
    """Remove a prefix and all options from the command x."""
    if not x.startswith(prefix):
        return x
    x = x[len(prefix):]
    i = 0
    last_was_minus = False
    for i, char in enumerate(x):
        if last_was_minus:
            if char == ' ':
                last_was_minus = False
        if char == '-':
            last_was_minus = True
        if char not in ['-', ' '] and not last_was_minus:
            break
    x = x[i:]
    return x
