diff options
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/initdb/initdb.sh | 4 | ||||
-rw-r--r-- | src/bin/initlocation/initlocation.sh | 4 | ||||
-rw-r--r-- | src/bin/pg_passwd/pg_passwd.c | 4 | ||||
-rw-r--r-- | src/bin/psql/startup.c | 24 | ||||
-rw-r--r-- | src/bin/scripts/createdb | 4 | ||||
-rw-r--r-- | src/bin/scripts/createlang.sh | 4 | ||||
-rw-r--r-- | src/bin/scripts/createuser | 4 | ||||
-rw-r--r-- | src/bin/scripts/dropdb | 4 | ||||
-rw-r--r-- | src/bin/scripts/droplang | 4 | ||||
-rw-r--r-- | src/bin/scripts/dropuser | 4 | ||||
-rw-r--r-- | src/bin/scripts/vacuumdb | 4 |
11 files changed, 40 insertions, 24 deletions
diff --git a/src/bin/initdb/initdb.sh b/src/bin/initdb/initdb.sh index 22843e6fd95..b83b1810250 100644 --- a/src/bin/initdb/initdb.sh +++ b/src/bin/initdb/initdb.sh @@ -24,7 +24,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.116 2000/11/21 20:55:57 tgl Exp $ +# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.117 2000/11/25 19:05:43 petere Exp $ # #------------------------------------------------------------------------- @@ -253,7 +253,7 @@ do ;; -*) echo "$CMDNAME: invalid option: $1" - echo "Try '$CMDNAME -?' for help." + echo "Try '$CMDNAME --help' for more information." exit 1 ;; *) diff --git a/src/bin/initlocation/initlocation.sh b/src/bin/initlocation/initlocation.sh index df8abda1f43..10c802c228d 100644 --- a/src/bin/initlocation/initlocation.sh +++ b/src/bin/initlocation/initlocation.sh @@ -8,7 +8,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.9 2000/11/11 22:59:46 petere Exp $ +# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.10 2000/11/25 19:05:43 petere Exp $ # #------------------------------------------------------------------------- @@ -51,7 +51,7 @@ do -*) echo "$CMDNAME: invalid option: $1" 1>&2 - echo "Try '$CMDNAME -?' for help." 1>&2 + echo "Try '$CMDNAME --help' for more information." 1>&2 exit 1 ;; *) diff --git a/src/bin/pg_passwd/pg_passwd.c b/src/bin/pg_passwd/pg_passwd.c index 6faad3088be..db057c88783 100644 --- a/src/bin/pg_passwd/pg_passwd.c +++ b/src/bin/pg_passwd/pg_passwd.c @@ -333,7 +333,7 @@ main(int argc, char *argv[]) if (argc != 2) { - fprintf(stderr, "%s: too %s arguments\nTry '%s -?' for help.\n", + fprintf(stderr, "%s: too %s arguments\nTry '%s --help' for more information.\n", progname, argc > 2 ? "many" : "few", progname); exit(1); } @@ -350,7 +350,7 @@ main(int argc, char *argv[]) } if (argv[1][0] == '-') { - fprintf(stderr, "%s: invalid option: %s\nTry '%s -?' for help.\n", + fprintf(stderr, "%s: invalid option: %s\nTry '%s --help' for more information.\n", progname, argv[1], progname); exit(1); } diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c index 46e476a2ae0..1a66d5fce36 100644 --- a/src/bin/psql/startup.c +++ b/src/bin/psql/startup.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.39 2000/11/13 23:37:53 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.40 2000/11/25 19:05:44 petere Exp $ */ #include "postgres.h" @@ -107,6 +107,20 @@ main(int argc, char *argv[]) else pset.progname = strrchr(argv[0], SEP_CHAR) + 1; + if (argc > 1) + { + if (strcmp(argv[1], "--help")==0 || strcmp(argv[1], "-?")==0) + { + usage(); + exit(EXIT_SUCCESS); + } + if (strcmp(argv[1], "--version")==0 || strcmp(argv[1], "-V")==0) + { + showVersion(); + exit(EXIT_SUCCESS); + } + } + pset.cur_cmd_source = stdin; pset.cur_cmd_interactive = false; pset.encoding = PQenv2encoding(); @@ -520,19 +534,21 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options) /* unknown option reported by getopt */ else { - fputs("Try -? for help.\n", stderr); + fprintf(stderr, "Try '%s --help' for more information.\n", + pset.progname); exit(EXIT_FAILURE); } break; #ifndef HAVE_GETOPT_LONG case '-': fprintf(stderr, "%s was compiled without support for long options.\n" - "Use -? for help on invocation options.\n", pset.progname); + "Use --help for help on invocation options.\n", pset.progname); exit(EXIT_FAILURE); break; #endif default: - fputs("Try -? for help.\n", stderr); + fprintf(stderr, "Try '%s --help' for more information.\n", + pset.progname); exit(EXIT_FAILURE); break; } diff --git a/src/bin/scripts/createdb b/src/bin/scripts/createdb index e506af5885c..3937b619138 100644 --- a/src/bin/scripts/createdb +++ b/src/bin/scripts/createdb @@ -11,7 +11,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.11 2000/11/13 23:37:53 momjian Exp $ +# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.12 2000/11/25 19:05:44 petere Exp $ # #------------------------------------------------------------------------- @@ -89,7 +89,7 @@ do ;; -*) echo "$CMDNAME: invalid option: $1" 1>&2 - echo "Try '$CMDNAME -?' for help." 1>&2 + echo "Try '$CMDNAME --help' for more information." 1>&2 exit 1 ;; *) diff --git a/src/bin/scripts/createlang.sh b/src/bin/scripts/createlang.sh index 02c27aaf90b..db4189bd072 100644 --- a/src/bin/scripts/createlang.sh +++ b/src/bin/scripts/createlang.sh @@ -8,7 +8,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.20 2000/11/20 20:36:50 tgl Exp $ +# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.21 2000/11/25 19:05:44 petere Exp $ # #------------------------------------------------------------------------- @@ -99,7 +99,7 @@ do -*) echo "$CMDNAME: invalid option: $1" 1>&2 - echo "Try '$CMDNAME -?' for help." 1>&2 + echo "Try '$CMDNAME --help' for more information." 1>&2 exit 1 ;; *) diff --git a/src/bin/scripts/createuser b/src/bin/scripts/createuser index e3859eb2a75..37a76368055 100644 --- a/src/bin/scripts/createuser +++ b/src/bin/scripts/createuser @@ -8,7 +8,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.14 2000/11/13 23:37:53 momjian Exp $ +# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.15 2000/11/25 19:05:44 petere Exp $ # # Note - this should NOT be setuid. # @@ -110,7 +110,7 @@ do ;; -*) echo "$CMDNAME: invalid option: $1" 1>&2 - echo "Try '$CMDNAME -?' for help." 1>&2 + echo "Try '$CMDNAME --help' for more information." 1>&2 exit 1 ;; *) diff --git a/src/bin/scripts/dropdb b/src/bin/scripts/dropdb index 35bb08a71af..a3db4babe32 100644 --- a/src/bin/scripts/dropdb +++ b/src/bin/scripts/dropdb @@ -10,7 +10,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.9 2000/11/13 23:37:53 momjian Exp $ +# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.10 2000/11/25 19:05:44 petere Exp $ # #------------------------------------------------------------------------- @@ -83,7 +83,7 @@ do ;; -*) echo "$CMDNAME: invalid option: $1" 1>&2 - echo "Try '$CMDNAME -?' for help." 1>&2 + echo "Try '$CMDNAME --help' for more information." 1>&2 exit 1 ;; *) diff --git a/src/bin/scripts/droplang b/src/bin/scripts/droplang index 023ae4fc996..43154b2e7d8 100644 --- a/src/bin/scripts/droplang +++ b/src/bin/scripts/droplang @@ -8,7 +8,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.10 2000/11/13 23:37:53 momjian Exp $ +# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.11 2000/11/25 19:05:44 petere Exp $ # #------------------------------------------------------------------------- @@ -89,7 +89,7 @@ do -*) echo "$CMDNAME: invalid option: $1" 1>&2 - echo "Try '$CMDNAME -?' for help." 1>&2 + echo "Try '$CMDNAME --help' for more information." 1>&2 exit 1 ;; *) diff --git a/src/bin/scripts/dropuser b/src/bin/scripts/dropuser index e7be5dc867a..21e71d87058 100644 --- a/src/bin/scripts/dropuser +++ b/src/bin/scripts/dropuser @@ -8,7 +8,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.9 2000/11/13 23:37:53 momjian Exp $ +# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.10 2000/11/25 19:05:44 petere Exp $ # # Note - this should NOT be setuid. # @@ -85,7 +85,7 @@ do ;; -*) echo "$CMDNAME: invalid option: $1" 1>&2 - echo "Try '$CMDNAME -?' for help." 1>&2 + echo "Try '$CMDNAME --help' for more information." 1>&2 exit 1 ;; *) diff --git a/src/bin/scripts/vacuumdb b/src/bin/scripts/vacuumdb index 0981f31e72c..9b310327a1f 100644 --- a/src/bin/scripts/vacuumdb +++ b/src/bin/scripts/vacuumdb @@ -11,7 +11,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.12 2000/11/13 23:37:53 momjian Exp $ +# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.13 2000/11/25 19:05:44 petere Exp $ # #------------------------------------------------------------------------- @@ -102,7 +102,7 @@ do -*) echo "$CMDNAME: invalid option: $1" 1>&2 - echo "Try '$CMDNAME -?' for help." 1>&2 + echo "Try '$CMDNAME --help' for more information." 1>&2 exit 1 ;; *) |