def _help_text()

in ebcli/core/abstractcontroller.py [0:0]


    def _help_text(self):
        """
        Returns the help text displayed when for the commands of the type `eb <command> <subcommand>`
        except where <command> is "platform".
        """
        longest = 0

        def pad(label):
            padlength = longest - len(label) + 2
            padding = '   '
            if padlength < 0:
                for x in range(0, longest):
                    padding += ' '
            else:
                for x in range(0, padlength):
                    padding += ' '
            return padding

        help_txt = ''
        for label in self._visible_commands:
            if len(label) > longest:
                longest = len(label)

        for label in self._visible_commands:
            cmd = self._dispatch_map[label]
            cmd_txt = '  '

            cmd_name = label
            cmd_aliases = cmd['aliases']

            if len(cmd_aliases) > 0 and cmd['aliases_only']:
                cmd_name = cmd_aliases.pop(0)

            cmd_txt += '{}'.format(cmd_name)

            if cmd['help']:
                cmd_txt += '{}{}'.format(pad(cmd_txt), cmd['help'])

            if len(cmd_aliases) > 0:
                cmd_txt += '\n{}(alias: {})'.format(pad(''), ', '.join(cmd_aliases))

            cmd_txt += '\n'
            help_txt += cmd_txt

        if len(help_txt) > 0:
            txt = '''{}