From: Mark Wooding Date: Sat, 6 Oct 2012 22:43:05 +0000 (+0100) Subject: Improve consistency in program version strings. X-Git-Tag: 0.99.2~2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/distorted-keys/commitdiff_plain/1d0c984e332f288dd3db8f67831dcf662c3e9b1b Improve consistency in program version strings. Previously, `shamir' had no version string at all; programs based on `keyfunc.sh' didn't print their program name, and `extract-profile' didn't print the package name. --- diff --git a/extract-profile.in b/extract-profile.in index 03fe455..0de7af0 100755 --- a/extract-profile.in +++ b/extract-profile.in @@ -407,7 +407,7 @@ def parse(filename, d): OP = O.OptionParser( usage = '%prog SECTION FILE|DIRECTORY ...', - version = '%%prog, version %s' % VERSION, + version = '%%prog, %s version %s' % (PACKAGE, VERSION), description = '''\ Parse the configurations FILE and DIRECTORY contents, and output the named SECTION as a sequence of simple assignments. diff --git a/keyfunc.sh.in b/keyfunc.sh.in index 31843bf..704122b 100644 --- a/keyfunc.sh.in +++ b/keyfunc.sh.in @@ -670,7 +670,7 @@ usage_err () { usage >&2; exit 1; } ### Subcommand handling. version () { - echo "$PACKAGE version $VERSION" + echo "$quis, $PACKAGE version $VERSION" } unset cmdargs diff --git a/shamir.in b/shamir.in index 06da00f..019efc9 100755 --- a/shamir.in +++ b/shamir.in @@ -32,6 +32,9 @@ import base64 as B from cStringIO import StringIO import optparse as OPT +PACKAGE = '@PACKAGE@' +VERSION = '@VERSION@' + ###-------------------------------------------------------------------------- ### Arithmetic in GF(2^8). ### @@ -543,7 +546,10 @@ class SubcommandOptionParser (OPT.OptionParser, object): opts, args = op.parse_args(args[1:]) sub.func(gopts, opts, args) -OPTPARSE = SubcommandOptionParser(description = """\ +OPTPARSE = SubcommandOptionParser( + usage = '%prog SUBCOMMAND [ARGS ...]', + version = '%%prog, %s version %s' % (PACKAGE, VERSION), + description = """\ Split and recombine secrets using Shamir's secret sharing system. """)