@@ -48,7 +48,7 @@ parseCommandLine(int argc, char *argv[])
4848 {"old-port" , required_argument , NULL , 'p' },
4949 {"new-port" , required_argument , NULL , 'P' },
5050
51- {"user " , required_argument , NULL , 'u ' },
51+ {"username " , required_argument , NULL , 'U ' },
5252 {"check" , no_argument , NULL , 'c' },
5353 {"link" , no_argument , NULL , 'k' },
5454 {"retain" , no_argument , NULL , 'r' },
@@ -82,8 +82,7 @@ parseCommandLine(int argc, char *argv[])
8282
8383 if (argc > 1 )
8484 {
85- if (strcmp (argv [1 ], "--help" ) == 0 || strcmp (argv [1 ], "-h" ) == 0 ||
86- strcmp (argv [1 ], "-?" ) == 0 )
85+ if (strcmp (argv [1 ], "--help" ) == 0 || strcmp (argv [1 ], "-?" ) == 0 )
8786 {
8887 usage ();
8988 exit (0 );
@@ -102,7 +101,7 @@ parseCommandLine(int argc, char *argv[])
102101 if ((log_opts .internal = fopen_priv (INTERNAL_LOG_FILE , "a" )) == NULL )
103102 pg_log (PG_FATAL , "cannot write to log file %s\n" , INTERNAL_LOG_FILE );
104103
105- while ((option = getopt_long (argc , argv , "d:D:b:B:cj:ko:O:p:P:ru :v" ,
104+ while ((option = getopt_long (argc , argv , "d:D:b:B:cj:ko:O:p:P:rU :v" ,
106105 long_options , & optindex )) != -1 )
107106 {
108107 switch (option )
@@ -170,9 +169,10 @@ parseCommandLine(int argc, char *argv[])
170169 log_opts .retain = true;
171170 break ;
172171
173- case 'u ' :
172+ case 'U ' :
174173 pg_free (os_info .user );
175174 os_info .user = pg_strdup (optarg );
175+ os_info .user_specified = true;
176176
177177 /*
178178 * Push the user name into the environment so pre-9.1
@@ -229,33 +229,33 @@ usage(void)
229229 pg_upgrade [OPTION]...\n\
230230\n\
231231Options:\n\
232- -b, --old-bindir=OLDBINDIR old cluster executable directory\n\
233- -B, --new-bindir=NEWBINDIR new cluster executable directory\n\
232+ -b, --old-bindir=BINDIR old cluster executable directory\n\
233+ -B, --new-bindir=BINDIR new cluster executable directory\n\
234234 -c, --check check clusters only, don't change any data\n\
235- -d, --old-datadir=OLDDATADIR old cluster data directory\n\
236- -D, --new-datadir=NEWDATADIR new cluster data directory\n\
235+ -d, --old-datadir=DATADIR old cluster data directory\n\
236+ -D, --new-datadir=DATADIR new cluster data directory\n\
237237 -j, --jobs number of simultaneous processes or threads to use\n\
238238 -k, --link link instead of copying files to new cluster\n\
239239 -o, --old-options=OPTIONS old cluster options to pass to the server\n\
240240 -O, --new-options=OPTIONS new cluster options to pass to the server\n\
241- -p, --old-port=OLDPORT old cluster port number (default %d)\n\
242- -P, --new-port=NEWPORT new cluster port number (default %d)\n\
241+ -p, --old-port=PORT old cluster port number (default %d)\n\
242+ -P, --new-port=PORT new cluster port number (default %d)\n\
243243 -r, --retain retain SQL and log files after success\n\
244- -u , --user =NAME cluster superuser (default \"%s\")\n\
244+ -U , --username =NAME cluster superuser (default \"%s\")\n\
245245 -v, --verbose enable verbose internal logging\n\
246246 -V, --version display version information, then exit\n\
247- -?, -h, -- help show this help, then exit\n\
247+ -?, -- help show this help, then exit\n\
248248\n\
249249Before running pg_upgrade you must:\n\
250250 create a new database cluster (using the new version of initdb)\n\
251251 shutdown the postmaster servicing the old cluster\n\
252252 shutdown the postmaster servicing the new cluster\n\
253253\n\
254254When you run pg_upgrade, you must provide the following information:\n\
255- the data directory for the old cluster (-d OLDDATADIR )\n\
256- the data directory for the new cluster (-D NEWDATADIR )\n\
257- the \"bin\" directory for the old version (-b OLDBINDIR )\n\
258- the \"bin\" directory for the new version (-B NEWBINDIR )\n\
255+ the data directory for the old cluster (-d DATADIR )\n\
256+ the data directory for the new cluster (-D DATADIR )\n\
257+ the \"bin\" directory for the old version (-b BINDIR )\n\
258+ the \"bin\" directory for the new version (-B BINDIR )\n\
259259\n\
260260For example:\n\
261261 pg_upgrade -d oldCluster/data -D newCluster/data -b oldCluster/bin -B newCluster/bin\n\
0 commit comments