Code

pgtest.sh: Improved help/usage output.
authorSebastian Harl <sh@tokkee.org>
Mon, 22 Oct 2012 08:49:10 +0000 (10:49 +0200)
committerSebastian Harl <sh@tokkee.org>
Mon, 22 Oct 2012 08:49:10 +0000 (10:49 +0200)
pgtest.sh

index 546d2db4eb5c882256d0b966b86509dcb83e6136..d286d23a8e8bebd4f7afcfc02b9395c81ba198f4 100755 (executable)
--- a/pgtest.sh
+++ b/pgtest.sh
@@ -77,7 +77,7 @@ case "$1" in
        stop)
                if test $# -ne 1; then
                        echo "Too many arguments!" >&2
-                       echo "Usage: $0 setup" >&2
+                       echo "Usage: $0 stop" >&2
                        exit 1
                fi
                $BIN_DIR/pg_ctl -D $TARGET/var/lib/postgresql/main stop
@@ -93,6 +93,20 @@ case "$1" in
                ;;
        *)
                echo "Usage: $0 setup|client|stop|start" >&2
+               echo ""
+               echo "  - setup"
+               echo "    Set up a new PostgreSQL server listening on port 2345."
+               echo "  - client [<psql args>]"
+               echo "    Start a PostgreSQL interactive terminal connected to the"
+               echo "    PostgreSQL server on port 2345."
+               echo "  - start [-B [<postgres args>]]"
+               echo "    Start the PostgreSQL server."
+               echo "  - stop"
+               echo "    Stop the PostgreSQL server."
+               echo ""
+               echo "Environment variables:"
+               echo "  - TARGET"
+               echo "    Target directory of the PostgreSQL test setup."
                exit 1
                ;;
 esac