Пример #1
0
def help():
    txt = ""
    for section in describe.getSections():
        txt += "%s\n" % section
        for command in describe.getSectionCommands(section):
            info = describe.getCommandHelp(section, command)
            args = ""
            for arg in info["args"]:
                if arg["required"]:
                    args += "<"
                else:
                    args += "["

                args += arg["key"]

                if arg.get("default"):
                    args += "=%s" % arg["default"]

                if arg["required"]:
                    args += ">"
                else:
                    args += "]"
                args += " "
            txt += "  %-13s %-50s %s\n" % (command, args, info["info"].strip())
        txt += "\n"
    txt += "%-15s %-50s %s\n" % ("shell", "", "Start interactive shell")
    txt += "\n"
    return txt.strip()
Пример #2
0
def help():
    txt = ''
    for section in describe.getSections():
        txt += '%s\n' % section
        for command in describe.getSectionCommands(section):
            info = describe.getCommandHelp(section, command)
            args = ''
            for arg in info['args']:
                if arg['required']: args += '<'
                else: args += '['

                args += arg['key']

                if arg.get('default'):
                    args += '=%s' % arg['default']

                if arg['required']: args += '>'
                else: args += ']'
                args += ' '
            txt += '  %-13s %-50s %s\n' % (command, args, info['info'].strip())
        txt += '\n'
    txt += '%-15s %-50s %s\n' % ('shell', '', 'Start interactive shell')
    txt += '\n'
    return txt.strip()
Пример #3
0
def help():
    txt = ''
    for section in describe.getSections():
        txt += '%s\n' % section
        for command in describe.getSectionCommands(section):
            info = describe.getCommandHelp(section, command)
            args = ''
            for arg in info['args']:
                if arg['required']: args += '<'
                else: args += '['

                args += arg['key']

                if arg.get('default'):
                    args += '=%s' % arg['default']

                if arg['required']: args += '>'
                else: args += ']'
                args += ' '
            txt += '  %-13s %-50s %s\n' % (command, args, info['info'].strip())
        txt += '\n'
    txt += '%-15s %-50s %s\n' % ('shell', '', 'Start interactive shell')
    txt += '\n'
    return txt.strip()
Пример #4
0
    print ' '.join(values)


if __name__ == '__main__':
    idx = int(sys.argv[1])
    args = sys.argv[3:]

    #log('idx: %s' % idx)
    #log('args: %s' % args)

    if idx == 1:
        sections = describe.getSections()
        if args:
            arg = args.pop(0)
            for section in sections:
                if section.find(arg) == 0:
                    returnItems([section])
        else:
            returnItems(sections)

    elif idx == 2:
        section = args.pop(0)
        commands = describe.getSectionCommands(section)
        if args:
            arg = args.pop(0)
            for command in commands:
                if command.find(arg) == 0:
                    returnItems([command])
        else:
            returnItems(commands)
Пример #5
0
    print ' '.join(values)

if __name__ == '__main__':
    idx = int(sys.argv[1])
    args = sys.argv[3:]

    #log('idx: %s' % idx)
    #log('args: %s' % args)

    if idx == 1:
        sections = describe.getSections()
        if args:
            arg = args.pop(0)
            for section in sections:
                if section.find(arg) == 0:
                    returnItems([section])
        else:
            returnItems(sections)

    elif idx == 2:
        section = args.pop(0)
        commands = describe.getSectionCommands(section)
        if args:
            arg = args.pop(0)
            for command in commands:
                if command.find(arg) == 0:
                    returnItems([command])
        else:
            returnItems(commands)