keyfunc.sh.in, ktype.*: Make nub creation the job of `c_genkey'.
[distorted-keys] / keyfunc.sh.in
index 98354d1..c8a6073 100644 (file)
@@ -154,8 +154,14 @@ check () {
 
   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 ;;
@@ -431,7 +437,7 @@ $profile
 EOF
 
   ## Generate the key.
-  umask=$(umask); umask 077; >"$knub.new"; umask $umask
+  (umask 077; makenub >"$knub.new")
   k_generate "$kdir.new" "$knub.new"
   $hook "$kdir.new" "$knub.new"
 
@@ -664,7 +670,7 @@ usage_err () { usage >&2; exit 1; }
 ### Subcommand handling.
 
 version () {
-  echo "$PACKAGE version $VERSION"
+  echo "$quis, $PACKAGE version $VERSION"
 }
 
 unset cmdargs
@@ -720,6 +726,7 @@ $cmds
 EOF
        case $foundp in
          t)
+           usage; echo
            eval help=\$help_$cmdname; echo "$help"
            ;;
          nil)