~mdw
/
distorted-keys
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
keyfunc.sh.in: Print usage summary when writing command-specific help.
[distorted-keys]
/
keyfunc.sh.in
diff --git
a/keyfunc.sh.in
b/keyfunc.sh.in
index
6cba169
..
f257bb9
100644
(file)
--- a/
keyfunc.sh.in
+++ b/
keyfunc.sh.in
@@
-154,8
+154,14
@@
check () {
validp=t
case "$thing" in
validp=t
case "$thing" in
- *"$nl"*) validp=nil ;;
- *) if ! expr >/dev/null "Q$thing" : "Q$ckpat\$"; then validp=nil; fi ;;
+ *"$nl"*)
+ validp=nil
+ ;;
+ *)
+ if ! expr >/dev/null "Q$thing" : "\(Q$ckpat\)\$"; then
+ validp=nil
+ fi
+ ;;
esac
case $validp in
nil) echo >&2 "$quis: bad $ckwhat \`$thing'"; exit 1 ;;
esac
case $validp in
nil) echo >&2 "$quis: bad $ckwhat \`$thing'"; exit 1 ;;
@@
-621,14
+627,14
@@
recover () {
rdir=$KEYS/recov/$recov/$inst
if [ ! -f $rdir/$label.recov ]; then
rdir=$KEYS/recov/$recov/$inst
if [ ! -f $rdir/$label.recov ]; then
- echo >&2 "$quis:
no blob for \`$label' under recovery key \`$recov/$inst
'"
+ echo >&2 "$quis:
recovery key \`$recov/$inst' has no blob for \`$label
'"
exit 1
fi
reqsafe
tag=$recov.$inst
nub=$SAFE/keys.reveal/$tag/nub
if [ ! -f $nub ]; then
exit 1
fi
reqsafe
tag=$recov.$inst
nub=$SAFE/keys.reveal/$tag/nub
if [ ! -f $nub ]; then
- echo >&2 "$quis:
current
recovery key \`$recov/$inst' not revealed"
+ echo >&2 "$quis: recovery key \`$recov/$inst' not revealed"
exit 1;
fi
mktmp
exit 1;
fi
mktmp
@@
-664,7
+670,7
@@
usage_err () { usage >&2; exit 1; }
### Subcommand handling.
version () {
### Subcommand handling.
version () {
- echo "$PACKAGE version $VERSION"
+ echo "$
quis, $
PACKAGE version $VERSION"
}
unset cmdargs
}
unset cmdargs
@@
-720,6
+726,7
@@
$cmds
EOF
case $foundp in
t)
EOF
case $foundp in
t)
+ usage; echo
eval help=\$help_$cmdname; echo "$help"
;;
nil)
eval help=\$help_$cmdname; echo "$help"
;;
nil)