def main():
    usagestr = "usage: %prog [-h] [options] [args]"
    parser = optparse.OptionParser(usage = usagestr)

    parser.set_defaults(numnodes = 2, enablesdt = False,
                        sdturl = "tcp://127.0.0.1:50000/")
    parser.add_option("-n", "--numnodes", dest = "numnodes", type = int,
                      help = "number of nodes to test; default = %s" %
                      parser.defaults["numnodes"])
    parser.add_option("-s", "--sdt", dest = "enablesdt", action = "store_true",
                      help = "enable SDT output")
    parser.add_option("-u", "--sdturl", dest = "sdturl", type = "string",
                      help = "URL for SDT connection, default = %s" % \
                      parser.defaults["sdturl"])

    def usage(msg = None, err = 0):
        sys.stdout.write("\n")
        if msg:
            sys.stdout.write(msg + "\n\n")
        parser.print_help()
        sys.exit(err)

    # parse command line options
    (options, args) = parser.parse_args()

    if options.numnodes < 2:
        usage("invalid number of nodes: %s" % options.numnodes)

    for a in args:
        sys.stderr.write("ignoring command line argument: '%s'\n" % a)

    start = datetime.datetime.now()

    test(options)

    print >> sys.stderr, \
          "elapsed time: %s" % (datetime.datetime.now() - start)
dataset/ETHPy150Open coreemu/core/daemon/examples/netns/basicrange.py/main/original