add support for --version to certmaster daemon
authorAdrian Likins <alikins@redhat.com>
Thu, 11 Jun 2009 20:36:39 +0000 (16:36 -0400)
committerAdrian Likins <alikins@redhat.com>
Thu, 11 Jun 2009 20:36:39 +0000 (16:36 -0400)
certmaster/certmaster.py

index 58cb50b..9548b8b 100644 (file)
@@ -352,12 +352,15 @@ def main(argv):
     sys.excepthook = excepthook  
     cm = CertMaster('/etc/certmaster/certmaster.conf')
 
+    if "--version" in sys.argv or "-v" in sys.argv:
+        print >> sys.stderr, file("/etc/certmaster/version").read().strip()
+        sys.exit(0)
+
     if "daemon" in argv or "--daemon" in argv:
         utils.daemonize("/var/run/certmaster.pid")
     else:
         print "serving...\n"
 
-
     # just let exceptions bubble up for now
     serve(cm)