diff options
author | Ben Konrath <ben@bagu.org> | 2009-12-01 18:47:16 -0500 |
---|---|---|
committer | Ben Konrath <ben@bagu.org> | 2009-12-01 18:47:16 -0500 |
commit | 6ba9889f6f80f9ff0228521bb8ba8bde3537f707 (patch) | |
tree | 932b677ea51e9052d1373c47b730d37d1bf072ff | |
parent | b23aed87f8bbfb5960317b339b423b8e9cbafdb7 (diff) | |
download | caribou-6ba9889f6f80f9ff0228521bb8ba8bde3537f707.tar.gz |
Add --version command line argumentCARIBOU_0_0_1
-rw-r--r-- | src/caribou.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/caribou.py b/src/caribou.py index 3a38d1e..8d51c83 100644 --- a/src/caribou.py +++ b/src/caribou.py @@ -132,11 +132,12 @@ def usage(): print _("Help Options:") print " -d, --debug " + _("Print debug messages on stdout") print " -h, --help " + _("Show this help message") + print " -v, --version " + _("Display version") if __name__ == "__main__": try: - options, xargs = getopt.getopt(sys.argv[1:], "dh", ["debug", "help"]) + options, xargs = getopt.getopt(sys.argv[1:], "dhv", ["debug", "help", "version"]) except getopt.GetoptError, e: print "Error: " + e.__str__() + "\n" usage() @@ -150,6 +151,10 @@ if __name__ == "__main__": usage() sys.exit(0) + if opt in ("-v", "--version"): + print "caribou @VERSION@" + sys.exit(0) + test = Test() # TODO: make a for loop #EVENTS = ["object:state-changed:focused", "object:text-caret-moved"] |