'generates the help text based on commands typed'

def generate_help_text(self, text):

    command = param_descrip = example = u''
    any_documentation = False
    is_command = True
    (rows, _) = get_window_dim()
    rows = int(rows)
    if (not self.completer):
        return (param_descrip, example)
    for word in text.split():
        if word.startswith(u'-'):
            is_command = False
        if is_command:
            command += (str(word) + u'    ')
        if (self.completer and self.completer.is_completable(command.rstrip())):
            cmdstp = command.rstrip()
            any_documentation = True
            if ((word in self.completer.command_parameters[cmdstp]) and self.completer.has_description(((cmdstp + u'    ') + word))):
                param_descrip = ((word + u':\n') + self.completer.param_description.get(((cmdstp + u'    ') + word), u''))
            self.description_docs = u'{}'.format(self.completer.command_description[cmdstp])
            if (cmdstp in self.completer.command_examples):
                string_example = u''
                for example in self.completer.command_examples[cmdstp]:
                    for part in example:
                        string_example += part
                example = space_examples(self.completer.command_examples[cmdstp], rows, get_section())
    if (not any_documentation):
        self.description_docs = u''
    return (param_descrip, example)
