Print help to the console.

    :return: 0 on success, 1 on failure
439422
def print_help(self):
    
    def print_hint():
      print('Use `pants goals` to list goals.')
      print('Use `pants help` to get help.')
    if isinstance(self._help_request, VersionHelp):
      print(pants_version())
    elif isinstance(self._help_request, OptionsHelp):
      self._print_options_help()
    elif isinstance(self._help_request, GoalsHelp):
      self._print_goals_help()
    elif isinstance(self._help_request, UnknownGoalHelp):
      print('Unknown goals: {}'.format(', '.join(self._help_request.unknown_goals)))
      print_hint()
      return 1
    elif isinstance(self._help_request, NoGoalHelp):
      print('No goals specified.')
      print_hint()
      return 1
    return 0
902064
def help(self, context):
        
        context.info('%s\n%s [global options] [task] [task options]...\n' % (self.name, sys.argv[0]))

        def print_parameter(prn, p):
            if p.description:
                suffix = '    - {0.description}'.format(p)
            else:
                suffix = ''
            if p.constraint is bool:
                prn('    {0.arg_name}'.format(p) + suffix)
            else:
                prn('    {0.arg_name} [{0.value}]'.format(p) + suffix)

        context.info('Global options:')
        for parameter in self.context_parameters.values():
            print_parameter(context.info, parameter)
        context.info()

        context.info('Commands:')
        name_template = '  {0.name:<%d}' % min(max(map(len, self.available_tasks)), 20)
        for task in self.available_tasks.values():
            printer = context.debug if task.hidden else context.info
            if task.description:
                printer((name_template + ' - {0.description}').format(task))
            else:
                printer(name_template.format(task))
            for parameter in task.parameters.values():
                print_parameter(printer, parameter)
986989
def _print_help(self):
        
        options = self._print_usage('\n  ', file=sys.stdout)
        if self.docstring:
            print()
            try:
                doc_string = self.docstring.format(**self._variables)
            except KeyError:
                doc_string = self.docstring
            for doc in doc_string.split('\n'):
                doc = doc.strip()
                if len(doc) > 2:
                    print(textwrap.fill(textwrap.dedent(doc).strip(),
                                        width=80, initial_indent='  ',
                                        subsequent_indent='   '))
        print()
        if options:
            print('Options:')
            width = max(len(k) for k in self._options)
            for x, t in self._options.items():
                print(self._format_option(x, t, width))
            if self._get_variable('VERSION'):
                print('{0:{1}}'.format(self._version_options[0], width), end=' ')
                print('| ' + ' | '.join(self._version_options[1:]), 'print version',
                      '(%s)' % self._get_variable('VERSION'))
            print('{0:{1}}'.format(self._help_options[0], width), end=' ')
            print('| ' + ' | '.join(self._help_options[1:]), 'print this help')
            print()
602123
def help():
    """"""
    print("Please use '{} <target>' where <target> is one of"
          .format(sys.argv[0]))
    width = max(len(name) for name in TARGETS)
    for name, target in TARGETS.items():
        print('  {name:{width}} {descr}'.format(name=name, width=width,
                                                descr=target.__doc__))
182206
def do_info(self, arg, arguments):
        
        if arguments["--all"]:
            Console.ok(70 * "-")
            Console.ok('DIR')
            Console.ok(70 * "-")
            for element in dir(self):
                Console.ok(str(element))
            Console.ok(70 * "-")
        self.print_info()
1149700
def error(self, message):
        """"""
        sys.stderr.write('error: %s\n\n' % message)
        self.print_help()
        sys.exit(2)
986922
def failure_message(self, fail):
        
        try:
            return u'{0}: {1}'.format(
                fail._value.__class__.__name__,
                str(fail._value),
            )
        except Exception:
            return u'Failed to produce failure message for "{0}"'.format(fail)
742382
def help(self, command=None):
    '''

    '''
    from spython.utils import check_install
    check_install()

    cmd = ['singularity','--help']
    if command != None:
        cmd.append(command)
    help = self._run_command(cmd)
    return help
210811
def help(self, args=None, userlevel=9):
        """"""
        out = [main.__file__+"\n"]

        if args is not None:
            parsed = self.parse(args, ignore_help=True)
        else:
            parsed = self._default_dict()

        for thing in self.options:
            if type(thing) == str:
                out.append("     "+thing)
            elif thing[0] <= userlevel:
                out.append("     %10s   %s ( %s )" % (thing[1], thing[-1], str(parsed[thing[2]])))

        return "\n".join(out)+"\n"
568201
def do_help(self, arg):
        
        cmds = arg.split()

        if cmds:
            func = getattr(self, 'do_{}'.format(cmds[0]))
            if func:
                _LOGGING.info(func.__doc__)
            else:
                _LOGGING.error('Command %s not found', cmds[0])
        else:
            _LOGGING.info("Available command list: ")
            for curr_cmd in dir(self.__class__):
                if curr_cmd.startswith("do_") and not curr_cmd == 'do_test':
                    print(" - ", curr_cmd[3:])
            _LOGGING.info("For help with a command type `help command`")
144363
def success(text):
    ''''''
    print(' '.join((green('✔'), white(text))))
    sys.stdout.flush()
1201342
def help(self):
        ''''''
        # This returns a help string for a given task of the form:
        #
        # ==================================================
        # <name>
        # ============================== (If supplied)
        # <docstring>
        # ============================== (If overrides other tasks)
        # Overrides <other task file>
        # ==============================
        # From <file> on <line>
        # ==============================
        # <name>(Argspec)
        result = [
            '=' * 50,
            self.name
        ]

        # And the doc, if it exists
        if self.doc:
            result.extend([
                '=' * 30,
                self.doc
            ])

        override = self.overrides
        while override:
            if isinstance(override, Shovel):
                result.append('Overrides module')
            else:
                result.append('Overrides %s' % override.file)
            override = override.overrides

        # Print where we read this function in from
        result.extend([
            '=' * 30,
            'From %s on line %i' % (self.file, self.line),
            '=' * 30,
            '%s%s' % (self.name, str(Args(self.spec)))
        ])
        return os.linesep.join(result)
683367
def print_success(msg):
    
    if IS_POSIX:
        print(u"%s[INFO] %s%s" % (ANSI_OK, msg, ANSI_END))
    else:
        print(u"[INFO] %s" % (msg))
1050092
def handle_completion(self):
        
        # We don't want these in the help, so handle them explicitely
        if len(sys.argv) > 1 and sys.argv[1].startswith("--help-completion-"):
            handler = getattr(self, sys.argv[1][2:].replace('-', '_'), None)
            if handler:
                print '\n'.join(sorted(handler()))
                self.STD_LOG_LEVEL = logging.DEBUG
                sys.exit(error.EX_OK)
1184792
def failure_message(self, fail):
        
        try:
            return u'{0}: {1}'.format(
                fail.value.__class__.__name__,
                fail.getErrorMessage(),
            )
        except Exception:
            return 'Failed to produce failure message for "{0}"'.format(fail)
837521
def show_help(self):
        """"""
        print("Sorry, not well understood.")
        print("- use", str(self.yes_input), "to answer 'YES'")
        print("- use", str(self.no_input), "to answer 'NO'")
615032
def help(self, *arg, **kwargs):
    
    name = arg[0]
    try:
        callback = self._commands[name]
    except KeyError:
        self._logger.info(' !help not found for: %s', name)
        return self.do_help.__doc__

    return callback.__doc__