diff -ruN postgresql-7.4.13-old/src/bin/pg_ctl/pg_ctl.sh postgresql-7.4.13/src/bin/pg_ctl/pg_ctl.sh
--- postgresql-7.4.13-old/src/bin/pg_ctl/pg_ctl.sh	2004-10-22 02:24:27.000000000 +0200
+++ postgresql-7.4.13/src/bin/pg_ctl/pg_ctl.sh	2006-08-05 17:16:17.000000000 +0200
@@ -139,31 +139,72 @@
 	    exit 0
 	    ;;
 	-D)
-	    shift
+	    PGDATA="$2"
+            if [ -z "$PGDATA" -o `echo x$PGDATA | cut -c1-2` = "x-" ]
+            then
+                echo "$CMDNAME: option '-D' specified without a data directory"
+                exit 1
+            fi
 	    # we need to do this so -D datadir shows in ps display
-	    PGDATAOPTS="-D $1"
-	    PGDATA="$1"
+	    PGDATAOPTS="-D $PGDATA"
 	    export PGDATA
+	    shift
 	    ;;
 	-l)
 	    logfile="$2"
+            if [ -z "$logfile" -o `echo x$logfile | cut -c1-2` = "x-" ]
+            then
+                echo "$CMDNAME: option '-l' specified without a logfile"
+                exit 1
+            fi
 	    shift;;
 	-l*)
 	    logfile=`echo "$1" | sed 's/^-l//'`
+            if [ -z "$logfile" -o `echo x$logfile | cut -c1-2` = "x-" ]
+            then
+                echo "$CMDNAME: option '-l' specified without a logfile"
+                exit 1
+            fi
 	    ;;
 	-m)
 	    shutdown_mode="$2"
+            if [ -z "$shutdown_mode" -o `echo x$shutdown_mode | cut -c1-2` = "x-" ]
+            then
+                echo "$CMDNAME: option '-m' specified without a shutdown mode"
+                exit 1
+            fi
 	    shift;;
 	-m*)
 	    shutdown_mode=`echo "$1" | sed 's/^-m//'`
+            if [ -z "$shutdown_mode" -o `echo x$shutdown_mode | cut -c1-2` = "x-" ]
+            then
+                echo "$CMDNAME: option '-m' specified without a shutdown mode"
+                exit 1
+            fi
 	    ;;
 	-o)
+	    POSTOPTS="$2"
+            if [ -z "$POSTOPTS" ]
+            then
+                echo "$CMDNAME: option '-o' specified without any passed options"
+                exit 1
+            fi
+            if [ `echo x$POSTOPTS | cut -c1-2` != x- ]
+            then
+                echo "$CMDNAME: option -o must be followed by one or more further options
+ to pass to the postmaster"
+                exit 1
+            fi
 	    shift
-	    POSTOPTS="$1"
 	    ;;
 	-p)
+	    po_path="$2"
+            if [ -z "$po_path" -o `echo x$po_path | cut -c1-2` = "x-" ]
+            then
+                echo "$CMDNAME: option '-p' specified without a path"
+                exit 1
+            fi
 	    shift
-	    po_path="$1"
 	    ;;
 	-s)
 	    silence_echo=:
