--- system-config-kickstart.py.orig 2009-08-05 08:04:18.000000000 -0400 +++ system-config-kickstart.py 2009-08-05 10:00:21.000000000 -0400 @@ -49,26 +49,36 @@ def useCliMode(value): fd.close() +def usage(): + print _("""Usage: system-config-kickstart [--help] [--generate ] [] + +--help Print out this message +--generate Generate a kickstart file from the current machine and write + it to . This option runs on the console, so it is + useful for servers that do not have X currently running. + This option will cause the GUI to launch with the values from + the kickstart file already filled in.""") + + file = None -opts, file = getopt.getopt(sys.argv[1:], "g:h", ["generate=", "help"]) +try: + opts, file = getopt.getopt(sys.argv[1:], "g:h", ["generate=", "help"]) +except getopt.GetoptError, err: + # print help information and exit: + print str(err) + usage() + sys.exit(2) + for (opt, value) in opts: if opt == "--generate" or opt == "-g": useCliMode(value) sys.exit(1) if opt == "--help" or opt == "-h": - print _("""Usage: system-config-kickstart [--help] [--generate ] [] - ---help Print out this message ---generate Generate a kickstart file from the current machine and write - it to . This option runs on the console, so it is - useful for servers that do not have X currently running. - This option will cause the GUI to launch with the values from - the kickstart file already filled in.""") + usage() sys.exit(1) - if file: file = file[0]