keyfunc.sh.in: Print usage summary when writing command-specific help.
[distorted-keys] / shamir.in
index 116c712..019efc9 100755 (executable)
--- a/shamir.in
+++ b/shamir.in
@@ -7,18 +7,20 @@
 
 ###----- Licensing notice ---------------------------------------------------
 ###
-### This program is free software; you can redistribute it and/or modify
+### This file is part of the distorted.org.uk key management suite.
+###
+### distorted-keys is free software; you can redistribute it and/or modify
 ### it under the terms of the GNU General Public License as published by
 ### the Free Software Foundation; either version 2 of the License, or
 ### (at your option) any later version.
 ###
-### This program is distributed in the hope that it will be useful,
+### distorted-keys is distributed in the hope that it will be useful,
 ### but WITHOUT ANY WARRANTY; without even the implied warranty of
 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ### GNU General Public License for more details.
 ###
 ### You should have received a copy of the GNU General Public License
-### along with this program; if not, write to the Free Software Foundation,
+### along with distorted-keys; if not, write to the Free Software Foundation,
 ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 from __future__ import with_statement
@@ -30,6 +32,9 @@ import base64 as B
 from cStringIO import StringIO
 import optparse as OPT
 
+PACKAGE = '@PACKAGE@'
+VERSION = '@VERSION@'
+
 ###--------------------------------------------------------------------------
 ### Arithmetic in GF(2^8).
 ###
@@ -541,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.
 """)