def command_string(command_dict, command_number=None, numbers=True,
                   time=True):
    """Create the string representation for the command entry.

    inputs:

    command_dict: A command dictionary of the form {"cmd": "<command",
    "ts": <timestamp>}. The "ts" arugment is optional.

    numbers: If true and comamnd_number is not None, then include the
    line numhber. If false, do not include the line number.

    time: If true, then include the timestamp. If false, do not
    include the timestamp.

    returns:

    A string represenation of the command.

    """
    string_rep = ""
    if numbers:
        string_rep += str(command_number) + ": "
    string_rep += command_dict["cmd"] + "\n"
    if time:
        string_rep += command_dict.get("ts", "<timestamp> missing")
        string_rep += "\n"

    return string_rep