def expand(items, vars):
    """Expands all variables in command that are in the form of %VAR% in vars.

    :param str list items: A list of strings you want to expand
    :param dict vars: A dictionary where the keys are the variables, and the
        values are the result of the expansion.
    """
    # This algorithm is a little inefficient since we loop through vars as
    # opposed to something like `while %XXX% in command`.  This is so we don't
    # mess around with any 'true' environment variables.  vars is probably going
    # to be a small dictionary anyway, so it's not too bad.  This also makes
    # a dead-simple loop exit, and we don't have to worry about users using
    # some other marking character.
    result = []
    for item in items:
        for variable, value in vars.items():
            if variable in item:
                item = item.replace(variable, value)

        result.append(item)

    return result