From: Adrian Likins Date: Thu, 11 Jun 2009 20:37:04 +0000 (-0400) Subject: add support for --version to certmaster-ca X-Git-Tag: v0.28~23 X-Git-Url: https://pwan.org/git/?a=commitdiff_plain;h=9eac159f5ba172e999d5e36c30bb458ea0f530e9;p=certmaster.git add support for --version to certmaster-ca Add a CertmasterCAOptionParser that adds "get_version" method to make --version work --- diff --git a/scripts/certmaster-ca b/scripts/certmaster-ca index 7370ef3..37a509c 100755 --- a/scripts/certmaster-ca +++ b/scripts/certmaster-ca @@ -7,6 +7,7 @@ import sys import glob +import optparse import os import certmaster @@ -15,15 +16,17 @@ import certmaster.certmaster -from optparse import OptionParser def errorprint(stuff): print >> sys.stderr, stuff +class CertmasterCAOptionParser(optparse.OptionParser): + def get_version(self): + return file("/etc/func/version").read().strip() def parseargs(args): usage = 'certmaster-ca