- try:
- options, args = getopt.gnu_getopt(
- argv[1:], 'b', ["bail", "help"] + ovs.daemon.LONG_OPTIONS)
- except getopt.GetoptError, geo:
- sys.stderr.write("%s: %s\n" % (ovs.util.PROGRAM_NAME, geo.msg))
- sys.exit(1)
+ parser = argparse.ArgumentParser(
+ description="Open vSwitch daemonization test program for Python.")
+ parser.add_argument("-b", "--bail", action="store_true",
+ help="Exit with an error after daemonize_start().")