def quote_path(v):
    """
    Quote the path if it is not already quoted.

    If v starts with '-', then assume that it is a -I option or similar
    and do not quote it.  This is fragile:  -Ipath with space needs to
    be quoted.
    """
    return '"' + v + '"' if v and ' ' in v and not v[0] in '"\'-' else v
