'Collects keys/aliases from commands
Args:
caller (Object, optional): If set, this is used to check access permissions
on each command. Only commands that pass are returned.
Returns:
names (list): A list of all command keys and aliases in this cmdset. If `caller`
was given, this list will only contain commands to which `caller` passed
the `call` locktype check.'

def get_all_cmd_keys_and_aliases(self, caller=None):

    names = []
    if caller:
        [names.extend(cmd._keyaliases) for cmd in self.commands if cmd.access(caller)]
    else:
        [names.extend(cmd._keyaliases) for cmd in self.commands]
    return names
