chiark / gitweb /
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 03fe455ac77d6fb03ef4bfb5d5bf8333ead8c9f0..0de7af0860594e30abcc29954405f480f1b5d9fd 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 31843bf9cac92978a97fecf98eef8308fb7955ac..704122bfcd2ebce4fe4e5c470fcfdc40ed13521f 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 06da00ff5e8656fb882c1b7228097972b64483a2..019efc95f9de64436732e0f5b4cf2968c382deae 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.
 """)