Added error messages default tip
authorviric@llimona
Mon, 14 May 2007 10:04:57 +0200
changeset 3 5b5abb696426
parent 2 11c4ec7423de
Added error messages
dm
--- a/dm	Sun May 13 22:20:06 2007 +0200
+++ b/dm	Mon May 14 10:04:57 2007 +0200
@@ -48,9 +48,18 @@
 
 function testdir
 {
+    if [ "$1x" == "x" ]; then
+        echo "Error: You should specify an alias for a directory." 1>&2
+        return 1
+    fi
     if [ -f ~/.dm ] ; then
         grep "^$1	" ~/.dm > /dev/null 2> /dev/null
+        if [ $? -ne 0 ]; then
+            echo "Error: There is no directory for '$1'" 1>&2
+            return 1
+        fi
     else
+        echo "Error: There is no directory for '$1'" 1>&2
         return 1
     fi
 }