pg_upgrade: change -u to -U, for consistency

Change -u (user) option to -U, for consistency with other tools like
pg_dump and psql.  Also expand --user to --username, again for
consistency.
BACKWARD INCOMPATIBILITY
This commit is contained in:
Bruce Momjian 2013-06-28 17:27:02 -04:00
parent 5893ffa79c
commit 457d6cf049
2 changed files with 6 additions and 6 deletions

View File

@ -48,7 +48,7 @@ parseCommandLine(int argc, char *argv[])
{"old-port", required_argument, NULL, 'p'}, {"old-port", required_argument, NULL, 'p'},
{"new-port", required_argument, NULL, 'P'}, {"new-port", required_argument, NULL, 'P'},
{"user", required_argument, NULL, 'u'}, {"username", required_argument, NULL, 'U'},
{"check", no_argument, NULL, 'c'}, {"check", no_argument, NULL, 'c'},
{"link", no_argument, NULL, 'k'}, {"link", no_argument, NULL, 'k'},
{"retain", no_argument, NULL, 'r'}, {"retain", no_argument, NULL, 'r'},
@ -102,7 +102,7 @@ parseCommandLine(int argc, char *argv[])
if ((log_opts.internal = fopen_priv(INTERNAL_LOG_FILE, "a")) == NULL) if ((log_opts.internal = fopen_priv(INTERNAL_LOG_FILE, "a")) == NULL)
pg_log(PG_FATAL, "cannot write to log file %s\n", INTERNAL_LOG_FILE); pg_log(PG_FATAL, "cannot write to log file %s\n", INTERNAL_LOG_FILE);
while ((option = getopt_long(argc, argv, "d:D:b:B:cj:ko:O:p:P:ru:v", while ((option = getopt_long(argc, argv, "d:D:b:B:cj:ko:O:p:P:rU:v",
long_options, &optindex)) != -1) long_options, &optindex)) != -1)
{ {
switch (option) switch (option)
@ -170,7 +170,7 @@ parseCommandLine(int argc, char *argv[])
log_opts.retain = true; log_opts.retain = true;
break; break;
case 'u': case 'U':
pg_free(os_info.user); pg_free(os_info.user);
os_info.user = pg_strdup(optarg); os_info.user = pg_strdup(optarg);
@ -241,7 +241,7 @@ Options:\n\
-p, --old-port=OLDPORT old cluster port number (default %d)\n\ -p, --old-port=OLDPORT old cluster port number (default %d)\n\
-P, --new-port=NEWPORT new cluster port number (default %d)\n\ -P, --new-port=NEWPORT new cluster port number (default %d)\n\
-r, --retain retain SQL and log files after success\n\ -r, --retain retain SQL and log files after success\n\
-u, --user=NAME cluster superuser (default \"%s\")\n\ -U, --username=NAME cluster superuser (default \"%s\")\n\
-v, --verbose enable verbose internal logging\n\ -v, --verbose enable verbose internal logging\n\
-V, --version display version information, then exit\n\ -V, --version display version information, then exit\n\
-?, -h, --help show this help, then exit\n\ -?, -h, --help show this help, then exit\n\

View File

@ -161,8 +161,8 @@
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><option>-u</option> <replaceable>user_name</></term> <term><option>-U</option> <replaceable>user_name</></term>
<term><option>--user=</option><replaceable>user_name</></term> <term><option>--username=</option><replaceable>user_name</></term>
<listitem><para>cluster's super user name; environment <listitem><para>cluster's super user name; environment
variable <envar>PGUSER</></para></listitem> variable <envar>PGUSER</></para></listitem>
</varlistentry> </varlistentry>