def create_cmnd(
    analysis, sim_start_date, sim_end_date, use_sim_manager, attributes, no_close
):
    """Create a command string for automatic processing."""
    args = []

    if use_sim_manager:
        args.append("UseSimManager")

    if sim_start_date:
        args.append(f"SimStartDate {sim_start_date[0]} {sim_start_date[1]}")

    if sim_end_date:
        args.append(f"SimEndDate {sim_end_date[0]} {sim_end_date[1]}")

    if attributes:
        args.extend([f"ChangeAttributeValue {attr} {val}" for attr, val in attributes])

    if no_close:
        args.extend(["NoClose"])

    types = {
        "eplus": "miGSS",
        "sbem": "miGCalculate",
        "dsm": "miGCalculate",  # not working
    }

    if analysis == "none":
        # this is used for cases when it's desired
        # only to update bunch of models
        pass

    else:
        try:
            args.append(types[analysis])

        except KeyError:
            raise KeyError("Incorrect analysis type: '{}'.".format(analysis))

    args.append("miTUpdate")

    if len(args) == 1:
        cmnd = "/process=" + args[0]
    else:
        cmnd = "/process=" + ", ".join(args)

    print(f"Running batch using '{cmnd}' command args. ")

    return cmnd