Index: /trunk/cereal/fs/usr/bin/cereal
===================================================================
--- /trunk/cereal/fs/usr/bin/cereal	(revision 540)
+++ /trunk/cereal/fs/usr/bin/cereal	(revision 541)
@@ -118,24 +118,30 @@
 ### MAIN
 
-COMMAND="$1"
-[ "$COMMAND" ] || failure "Type '$CMD help' for usage."
-shift
+handle_command() {
 
-case $COMMAND in
-    'attach'|'a')
-	attach "$@"
-	;;
-    'follow'|'f')
-	follow "$@"
-	;;
-    'list'|'l')
-	list "$@"
-	;;
-    'help'|'h'|'?')
-	usage
-	;;
-    *)
-	failure "Unknown command: '$COMMAND'
+    COMMAND="$1"
+
+    [ "$COMMAND" ] || failure "Type '$CMD help' for usage."
+    shift
+
+    case $COMMAND in
+	'attach'|'a')
+	    attach "$@"
+	    ;;
+	'follow'|'f')
+	    follow "$@"
+	    ;;
+	'list'|'l')
+	    list "$@"
+	    ;;
+	'help'|'h'|'?')
+	    usage
+	    ;;
+	*)
+	    failure "Unknown command: '$COMMAND'
 Type '$CMD help' for usage."
-	;;
-esac
+	    ;;
+    esac
+}
+
+handle_command "$@"
