normalize output for monkeysphere when no subcommand is issued or when an unknown...
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 11 Jan 2010 16:24:16 +0000 (11:24 -0500)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 11 Jan 2010 16:24:16 +0000 (11:24 -0500)
src/monkeysphere
src/monkeysphere-authentication
src/monkeysphere-host

index 36ecf9335b7b5732ad2e4cf266e112bd3ea9f117..bc390ccca5e239a83e00e594f576d16cdc6e8fd6 100755 (executable)
@@ -217,9 +217,13 @@ mkdir -p -m 0700 "$GNUPGHOME"
 export LOG_LEVEL
 export LOG_PREFIX
 
+if [ "$#" -eq 0 ] ; then 
+    usage
+    failure "Please supply a subcommand."
+fi
+
 # get subcommand
 COMMAND="$1"
-[ "$COMMAND" ] || (usage; exit 1)
 shift
 
 case $COMMAND in
@@ -285,6 +289,6 @@ case $COMMAND in
 
     *)
         failure "Unknown command: '$COMMAND'
-Type '$PGRM help' for usage."
+Try '$PGRM help' for usage."
         ;;
 esac
index 265ca32957caa4f2ac6d5d12b52cdd7c458423d1..dd44efe8637a6392c4a9c74a1405ff95663a8fab 100755 (executable)
@@ -149,9 +149,13 @@ export GNUPGHOME
 export CORE_KEYLENGTH
 export LOG_PREFIX
 
+if [ "$#" -eq 0 ] ; then 
+    usage
+    failure "Please supply a subcommand."
+fi
+
 # get subcommand
 COMMAND="$1"
-[ "$COMMAND" ] || (usage; exit 1)
 shift
 
 case $COMMAND in
@@ -217,6 +221,6 @@ case $COMMAND in
 
     *)
         failure "Unknown command: '$COMMAND'
-Type '$PGRM help' for usage."
+Try '$PGRM help' for usage."
         ;;
 esac
index 763a37b9dbf746802e2687f8b66c9903c54869ea..4a449de20aa2818c3b5fd5cc80a282ab207d9634 100755 (executable)
@@ -236,9 +236,13 @@ export GNUPGHOME
 export HOST_FINGERPRINT
 export LOG_PREFIX
 
+if [ "$#" -eq 0 ] ; then 
+    usage
+    failure "Please supply a subcommand."
+fi
+
 # get subcommand
 COMMAND="$1"
-[ "$COMMAND" ] || (usage; exit 1)
 shift
 
 case $COMMAND in
@@ -315,6 +319,6 @@ case $COMMAND in
 
     *)
         failure "Unknown command: '$COMMAND'
-Type '$PGRM help' for usage."
+Try '$PGRM help' for usage."
         ;;
 esac