From 1d0c984e332f288dd3db8f67831dcf662c3e9b1b Mon Sep 17 00:00:00 2001 Message-Id: <1d0c984e332f288dd3db8f67831dcf662c3e9b1b.1715451056.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sat, 6 Oct 2012 23:43:05 +0100 Subject: [PATCH] Improve consistency in program version strings. Organization: Straylight/Edgeware From: Mark Wooding 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. --- extract-profile.in | 2 +- keyfunc.sh.in | 2 +- shamir.in | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) 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. """) -- [mdw]