def METHOD_NAME(cmd: str, cmdset: set) -> None:
    """Add a command to the set of commands to be executed"""
    if isinstance(cmd, list):
        # the first command is what we need
        subcmd = cmd[0]['command'].split('|')[0].strip()
        cmdset.add(subcmd)
    else:
        cmdset.add(cmd.split('|')[0].strip())