Beispiel #1
0
    def run(self, topic=None):
        from siptracklib import help
        if not topic:
            help.show_global_help()
        else:
            help.show_topic_help(topic)

        return 0
Beispiel #2
0
    def run(self, topic = None):
        from siptracklib import help
        if not topic:
            help.show_global_help()
        else:
            help.show_topic_help(topic)

        return 0
Beispiel #3
0
def run_siptrack(argv):
    """'Siptrack real main'.
    
    Parses global commandline options and runs a command if one was given.
    """
    cm = siptracklib.connection_manager

    optdict = {}

    argv = [arg.decode(siptracklib.user_encoding) for arg in argv]

    while len(argv) > 0:
        if argv[0][0] != "-":
            break
        opt = argv.pop(0)
        parse_option(opt, argv, global_options, optdict)

    if "help" in optdict:
        from siptracklib.help import show_global_help

        show_global_help()
        return 1
    if "version" in optdict:
        from siptracklib.basecommands import show_version

        show_version()
        return 1
    if "server" in optdict:
        server_dict = utils.parse_connection_string(optdict["server"])
        del optdict["server"]
        cm.config.update(server_dict)
    cm.config.update(optdict)

    if len(argv) == 0:
        from siptracklib.help import show_global_help

        show_global_help()
        return 1

    return run_command(cm, argv[0], argv[1:])
Beispiel #4
0
def run_siptrack(argv):
    """'Siptrack real main'.
    
    Parses global commandline options and runs a command if one was given.
    """
    cm = siptracklib.connection_manager

    optdict = {}

    argv = [arg.decode(siptracklib.user_encoding) for arg in argv]

    while len(argv) > 0:
        if argv[0][0] != '-':
            break
        opt = argv.pop(0)
        parse_option(opt, argv, global_options, optdict)

    if 'help' in optdict:
        from siptracklib.help import show_global_help
        show_global_help()
        return 1
    if 'version' in optdict:
        from siptracklib.basecommands import show_version
        show_version()
        return 1
    if 'server' in optdict:
        server_dict = utils.parse_connection_string(optdict['server'])
        del optdict['server']
        cm.config.update(server_dict)
    cm.config.update(optdict)

    if len(argv) == 0:
        from siptracklib.help import show_global_help
        show_global_help()
        return 1

    return run_command(cm, argv[0], argv[1:])