Improve consistency in program version strings.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 6 Oct 2012 22:43:05 +0000 (23:43 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 6 Oct 2012 22:43:05 +0000 (23:43 +0100)
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
keyfunc.sh.in
shamir.in

index 03fe455..0de7af0 100755 (executable)
@@ -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.
index 31843bf..704122b 100644 (file)
@@ -670,7 +670,7 @@ usage_err () { usage >&2; exit 1; }
 ### Subcommand handling.
 
 version () {
-  echo "$PACKAGE version $VERSION"
+  echo "$quis, $PACKAGE version $VERSION"
 }
 
 unset cmdargs
index 06da00f..019efc9 100755 (executable)
--- 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.
 """)