display version with -v

This commit is contained in:
Chris Jones 2008-03-29 01:40:49 +00:00
parent b31fee31ed
commit 00e8127246
1 changed files with 5 additions and 0 deletions

View File

@ -945,6 +945,7 @@ if __name__ == '__main__':
usage = "usage: %prog [options]"
parser = OptionParser (usage)
parser.add_option ("-v", "--version", action="store_true", dest="version", help="Display program version")
parser.add_option ("-d", "--debug", action="store_true", dest="debug", help="Enable debugging information")
parser.add_option ("-m", "--maximise", action="store_true", dest="maximise", help="Open the %s window maximised"%APP_NAME.capitalize())
parser.add_option ("-f", "--fullscreen", action="store_true", dest="fullscreen", help="Set the window into fullscreen mode")
@ -958,6 +959,10 @@ if __name__ == '__main__':
if len (args) != 0:
parser.error("Expecting zero additional arguments, found: %d"%len (args))
if options.version:
print "%s %s"%(APP_NAME, APP_VERSION)
sys.exit (0)
command = []
if (options.command):
command.append (options.command)