示例#1
0
def get_help_text(argv):
    if argv:

        return getRouteHelp(argv[0].split('/'))

    else:

        return '\n'.join([
            'Usage:',
            '  $ ec module_path [flag] <command route> [args]',
            '\nFlags',
            ' -h    show help.',
            ' -p    execute a command with partial args.',
            '\nMembers\n-------\n',
            getRouteHelp([]),
        ])
示例#2
0
文件: dispatch.py 项目: Laufire/ec
def get_help_text(argv):
  if argv:

    return getRouteHelp(argv[0].split('/'))

  else:

    return '\n'.join(['Usage:',
      '  $ ec module_path [flag] <command route> [args]',
      '\nFlags',
      ' -h    show help.',
      ' -p    execute a command with partial args.',
      '\nMembers\n-------\n',
      getRouteHelp([]),
    ]
    )
示例#3
0
def help(route):
  r"""Displays help for the given route.

  Args:
    route (str): A route that resolves a member.
  """
  help_text = getRouteHelp(route.split('/') if route else [])

  if help_text is None:
    err('Can\'t help :(')

  else:
    print '\n%s' % help_text