Returns *how to use command* text.
438413
def usage(self, subcommand):
        
        usage = ' '.join(['%prog', subcommand, '[options]'])
        if self.args:
            usage = '%s %s' % (usage, str(self.args))
        return usage
949036
def get_command(self, ctx, name):
        """"""
        if not self._commands_dir:
            return defaults.get_command(ctx, name)

        ns = {}
        fn = os.path.join(self._commands_dir, name + '.py')

        try:
            with open(fn) as f:
                code = compile(f.read(), fn, 'exec')
        except IOError:
            return defaults.get_command(ctx, name)

        eval(code, ns, ns)

        CLI = 'cli'

        try:
            return ns[CLI]
        except KeyError:
            ctx.fail('`{}` not defined in "{}"'.format(CLI, name))
972726
def cmdLine(useBasename=False):
    """"""
    qargv = []
    cmdwords = list(sys.argv)
    if useBasename:
        cmdwords[0] = os.path.basename(cmdwords[0])
    for s in cmdwords:
        # any white space or special characters in word so we need quoting?
        if re.search(r'\s|\*|\?', s):
            if "'" in s:
                qargv.append('"%s"' % re.sub('"', "'", s))
            else:
                qargv.append("'%s'" % re.sub("'", '"', s))
        else:
            qargv.append(s)
    cmd = ' '.join(qargv)
    return cmd
161958
def text(self):
        """"""
        if callable(self._text):
            return str(self._text())
        return str(self._text)
993486
def get_command(self, ctx, name):
        """"""
        plugin = os.path.basename(self.folder)
        try:
            command = importlib.import_module("honeycomb.commands.{}.{}".format(plugin, name))
        except ImportError:
            raise click.UsageError("No such command {} {}\n\n{}".format(plugin, name, self.get_help(ctx)))
        return getattr(command, name)
748889
def cmd(send, msg, _):
    
    if not msg:
        send("What acronym?")
        return
    words = get_list()
    letters = [c for c in msg.lower() if c in string.ascii_lowercase]
    output = " ".join([choice(words[c]) for c in letters])
    if output:
        send('%s: %s' % (msg, output.title()))
    else:
        send("No acronym found for %s" % msg)
1101674
def get_primary_command_usage(message=''):
    # type: (str) -> str
    """"""
    if not settings.merge_primary_command and None in settings.subcommands:
        return format_usage(settings.subcommands[None].__doc__)
    if not message:
        message = '\n{}\n'.format(settings.message) if settings.message else ''
    doc = _DEFAULT_DOC.format(message=message)
    if None in settings.subcommands:
        return _merge_doc(doc, settings.subcommands[None].__doc__)
    return format_usage(doc)
1199761
def _print_command(self, cmd):
        """"""
        text = helpers.repr_bytes(cmd)
        self.outf.write(text)
        if not text.endswith(b'\n'):
            self.outf.write(b'\n')
11475
def reformat_cmd(self, text):
        
        # remove az if there
        text = text.replace('az', '')
        # disregard defaulting symbols
        if text and SELECT_SYMBOL['scope'] == text[0:2]:
            text = text.replace(SELECT_SYMBOL['scope'], "")

        if self.shell_ctx.default_command:
            text = self.shell_ctx.default_command + ' ' + text
        return text
1188439
def help(command): # this comes first to make it easy to spot
		'''  '''
		for i, v in ByPy.__dict__.items():
			if callable(v) and v.__doc__ and v.__name__ == command :
				help = v.__doc__.strip()
				pos = help.find(const.HelpMarker)
				if pos != -1:
					pr("Usage: " + help[pos + len(const.HelpMarker):].strip())
317192
def text(self):
        
        if self.m_name == -1 or self.m_event != TEXT:
            return ''

        return self.sb[self.m_name]
401942
def command(self):
        """"""
        if not self._command_calculated:

            self._command_calculated = True
            if self.operation == 'command':
                try:
                    command_idx = self.split_tokens.index('command:')
                    command = self.split_tokens[command_idx + 1]
                    if command == '{':
                        # workaround for <= 2.2 log files,
                        # where command was not listed separately
                        command = self.split_tokens[command_idx + 2][:-1]
                    self._command = command.lower()
                except ValueError:
                    pass

        return self._command
1152456
def format(self):
        

        values = {}
        title = "Description"
        description = self.command.description + "\n\n" + self.get_ending_note() if not self.is_cog() else inspect.getdoc(self.command)
        sections = []

        if isinstance(self.command, Command):
                description = self.command.short_doc
                sections = [{"name": "Usage", "value": self.get_command_signature()},
                            {"name": "More Info", "value": self.command.help.replace(self.command.short_doc, "").format(prefix=self.clean_prefix),
                             "inline": False}]

        def category(tup):
            cog = tup[1].cog_name
            return cog + ':' if cog is not None else '\u200bNo Category:'

        if self.is_bot():
            title = self.bot.user.display_name + " Help"
            data = sorted(self.filter_command_list(), key=category)
            for category, commands in itertools.groupby(data, key=category):
                section = {}
                commands = list(commands)
                if len(commands) > 0:
                    section['name'] = category
                section['value'] = self.add_commands(commands)
                section['inline'] = False
                sections.append(section)
        elif not sections or self.has_subcommands():
            section = {"name": "Commands:", "inline": False, "value": self.add_commands(self.filter_command_list())}
            sections.append(section)

        values['title'] = title
        values['description'] = description
        values['sections'] = sections
        return values
693809
def get_help(command):
    
    assert isinstance(command, click.Command)

    def help_(self):  # pylint: disable=unused-argument
        extra = {}
        for key, value in command.context_settings.items():
            if key not in extra:
                extra[key] = value

        # Print click's help message
        with click.Context(command, info_name=command.name, parent=self.ctx, **extra) as ctx:
            click.echo(ctx.get_help(), color=ctx.color)

    help_.__name__ = 'help_%s' % command.name
    return help_
372406
def text(self, cls='current', retaintokenisation=False):
        

        #backward compatibility, old versions didn't have cls as first argument, so if a boolean is passed first we interpret it as the 2nd:
        if cls is True or cls is False:
            retaintokenisation = cls
            cls = 'current'

        s = ""
        for c in self.data:
            if s: s += "\n\n\n"
            try:
                s += c.text(cls, retaintokenisation)
            except NoSuchText:
                continue
        return s
188216
def getPermissionText(self, t, m):
        '''
        
        '''
        try:
            return self.rights[t][m]['TEXT']
        except KeyError:
            raise CommandExecutionError((
                'No right "{0}".  It should be one of the following:  {1}')
                .format(m, ', '.join(self.rights[t])))
242314
def write_text(_command, txt_file):
    """"""
    command = _command.strip()
    with open(txt_file, 'w') as txt:
        txt.writelines(command)