fix invocation without subcommands to call usage function and exit 1 explicitlly
[monkeysphere.git] / src / monkeysphere
index 14d2bf042593f9ae1f8995a57cbbcf7bf40c33ce..36ecf9335b7b5732ad2e4cf266e112bd3ea9f117 100755 (executable)
@@ -45,12 +45,15 @@ Monkeysphere client tool.
 subcommands:
  update-known_hosts (k) [HOST]...    update known_hosts file
  update-authorized_keys (a)          update authorized_keys file
- gen-subkey (g) [KEYID]              generate an authentication subkey
-   --length (-l) BITS                  key length in bits (2048)
  ssh-proxycommand HOST [PORT]        monkeysphere ssh ProxyCommand
    --no-connect                        do not make TCP connection to host
  subkey-to-ssh-agent (s)             store authentication subkey in ssh-agent
  sshfpr (f) KEYID                    output ssh fingerprint of gpg key
+
+ keys-from-userid (u) USERID         output valid keys for user id literal
+ gen-subkey (g) [KEYID]              generate an authentication subkey
+   --length (-l) BITS                  key length in bits (2048)
+
  version (v)                         show version number
  help (h,?)                          this help
 
@@ -216,7 +219,7 @@ export LOG_PREFIX
 
 # get subcommand
 COMMAND="$1"
-[ "$COMMAND" ] || $PGRM help
+[ "$COMMAND" ] || (usage; exit 1)
 shift
 
 case $COMMAND in
@@ -268,11 +271,15 @@ case $COMMAND in
        gpg_ssh_fingerprint "$@"
        ;;
 
-    'version'|'v')
+    'keys-from-userid'|'u')
+       keys_from_userid "$@"
+       ;;
+
+    'version'|'--version'|'v')
        version
        ;;
 
-    '--help'|'help'|'-h'|'h'|'?')
+    'help'|'--help'|'-h'|'h'|'?')
         usage
         ;;