Пример #1
0
def print_help(goals=None):
  if goals:
    for goal in goals:
      phase = Phase(goal)
      if not phase.goals():
        print('\nUnknown goal: %s' % goal)
      else:
        parser = OptionParser(add_help_option=False)
        phase.setup_parser(parser, [], [phase])
        print('\n%s: %s' % (phase.name, phase.description))
        _print_flags(parser, phase.name)
  else:
    print(pants_release())
    print('\nUsage:')
    print('  ./pants goal [option ...] [goal ...] [target...]  Attempt the specified goals.')
    print('  ./pants goal help                                 Get help.')
    print('  ./pants goal help [goal]                          Get help for the specified goal.')
    print('  ./pants goal goals                                List all installed goals.')
    print('')
    print('  [target] accepts two special forms:')
    print('    dir:  to include all targets in the specified directory.')
    print('    dir:: to include all targets found recursively under the directory.')

    print('\nFriendly docs:\n  http://pantsbuild.github.io/')

    _print_global_flags()
Пример #2
0
def print_help(goals=None):
    if goals:
        for goal in goals:
            phase = Phase(goal)
            if not phase.goals():
                print('\nUnknown goal: %s' % goal)
            else:
                parser = OptionParser(add_help_option=False)
                phase.setup_parser(parser, [], [phase])
                print('\n%s: %s' % (phase.name, phase.description))
                _print_flags(parser, phase.name)
    else:
        print('Pants %s' % version.VERSION)
        print('\nUsage:')
        print(
            '  ./pants goal [option ...] [goal ...] [target...]  Attempt the specified goals.'
        )
        print('  ./pants goal help                                 Get help.')
        print(
            '  ./pants goal help [goal]                          Get help for the specified goal.'
        )
        print(
            '  ./pants goal goals                                List all installed goals.'
        )
        print('')
        print('  [target] accepts two special forms:')
        print('    dir:  to include all targets in the specified directory.')
        print(
            '    dir:: to include all targets found recursively under the directory.'
        )

        print('\nFriendly docs:\n  http://pantsbuild.github.io/')

        _print_global_flags()