Given a command part, find the path it represents.
    :throws ValueError: if no valid file is found.

def _get_path_by_name(part, paths):
    """ Given a command part, find the path it represents.
    :throws ValueError: if no valid file is found.
    """
    for path in paths:
        if path.alias == part:
            return path
    raise ValueError