def dict_to_cmd(cmd, flags, **kwargs):
    """Create a command string for cmd and parameters 'kwargs'."""
    cmd_str = cmd + " " + " ".join(["-{} {}".format(k, kwargs[k]) for k in kwargs])
    if flags:
        flag_str = " ".join(["-" + f for f in flags])
    else:
        flag_str = ""
    return cmd_str + " " + flag_str