Added new single-letter options to initdb.sh.

Removed long-option names that used ${#} shell feature which
was a compatability problem.
This commit is contained in:
Bruce Momjian 1996-10-03 00:23:42 +00:00
parent 67e8736348
commit a14bf40b88

View File

@ -26,7 +26,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.6 1996/09/23 08:23:17 scrappy Exp $ # $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.7 1996/10/03 00:23:42 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -57,24 +57,28 @@ noclean=0
template_only=0 template_only=0
POSTGRES_SUPERUSERNAME=$USER POSTGRES_SUPERUSERNAME=$USER
for ARG ; do while [ "$#" -gt 0 ]
if [ $ARG = "--debug" -o $ARG = "-d" ]; then do
if [ "$1" = "-d" ]; then
debug=1 debug=1
echo "Running with debug mode on." echo "Running with debug mode on."
elif [ $ARG = "--noclean" -o $ARG = "-n" ]; then elif [ "$1" = "-n" ]; then
noclean=1 noclean=1
echo "Running with noclean mode on. Mistakes will not be cleaned up." echo "Running with noclean mode on. Mistakes will not be cleaned up."
elif [ $ARG = "--template" ]; then elif [ "$1" = "-t" ]; then
template_only=1 template_only=1
echo "updating template1 database only." echo "updating template1 database only."
elif [ ${ARG#--username=} != $ARG ]; then elif [ "$1" = "-u" ]; then
POSTGRES_SUPERUSERNAME=${ARG,"--username="} shift
elif [ ${ARG#--pgdata=} != $ARG ]; then POSTGRES_SUPERUSERNAME="$1"
PGDATA=${ARG#--pgdata=} elif [ "$1" = "-r" ]; then
shift
PGDATA=$1
else else
echo "initdb [--template] [--debug] [--noclean]" \ echo "initdb [-t] [-d] [-n] [-u superuser] [-r datadir]" 1>&2
"[--username=SUPERUSER] [--pgdata=DATADIR]" exit 1
fi fi
shift
done done
if [ "$debug" -eq 1 ]; then if [ "$debug" -eq 1 ]; then