47
47
* Cleaned up code for reconnecting to database.
48
48
* Force a reconnect as superuser before enabling/disabling triggers.
49
49
*
50
+ * Modifications - 6-Mar-2001 - pjw@rhyme.com.au
51
+ * Change -U option to -L to allow -U to specify username in future.
52
+ *
50
53
*-------------------------------------------------------------------------
51
54
*/
52
55
@@ -100,7 +103,7 @@ struct option cmdopts[] = {
100
103
{ "superuser" , 1 , NULL , 'S' },
101
104
{ "table" , 2 , NULL , 't' },
102
105
{ "trigger" , 2 , NULL , 'T' },
103
- { "use-list" , 1 , NULL , 'U ' },
106
+ { "use-list" , 1 , NULL , 'L ' },
104
107
{ "verbose" , 0 , NULL , 'v' },
105
108
{ NULL , 0 , NULL , 0 }
106
109
};
@@ -135,9 +138,9 @@ int main(int argc, char **argv)
135
138
}
136
139
137
140
#ifdef HAVE_GETOPT_LONG
138
- while ((c = getopt_long (argc , argv , "acCd:f:F:h:i:lNoOp: P:rRsS:t:T:uU:vx " , cmdopts , NULL )) != EOF )
141
+ while ((c = getopt_long (argc , argv , "acCd:f:F:h:i:lL:NoOp: P:rRsS:t:T:uvx " , cmdopts , NULL )) != EOF )
139
142
#else
140
- while ((c = getopt (argc , argv , "acCd:f:F:h:i:lNoOp: P:rRsS:t:T:uU:vx " )) != -1 )
143
+ while ((c = getopt (argc , argv , "acCd:f:F:h:i:lL:NoOp: P:rRsS:t:T:uvx " )) != -1 )
141
144
#endif
142
145
{
143
146
switch (c )
@@ -173,6 +176,15 @@ int main(int argc, char **argv)
173
176
case 'i' :
174
177
opts -> ignoreVersion = 1 ;
175
178
break ;
179
+
180
+ case 'l' : /* Dump the TOC summary */
181
+ opts -> tocSummary = 1 ;
182
+ break ;
183
+
184
+ case 'L' : /* input TOC summary file name */
185
+ opts -> tocFile = strdup (optarg );
186
+ break ;
187
+
176
188
case 'N' :
177
189
opts -> origOrder = 1 ;
178
190
break ;
@@ -219,18 +231,11 @@ int main(int argc, char **argv)
219
231
opts -> selTable = 1 ;
220
232
opts -> tableNames = _cleanupName (optarg );
221
233
break ;
222
- case 'l' : /* Dump the TOC summary */
223
- opts -> tocSummary = 1 ;
224
- break ;
225
234
226
235
case 'u' :
227
236
opts -> requirePassword = 1 ;
228
237
break ;
229
238
230
- case 'U' : /* input TOC summary file name */
231
- opts -> tocFile = strdup (optarg );
232
- break ;
233
-
234
239
case 'v' : /* verbose */
235
240
opts -> verbose = 1 ;
236
241
break ;
@@ -251,29 +256,29 @@ int main(int argc, char **argv)
251
256
252
257
if (opts -> formatName ) {
253
258
254
- switch (opts -> formatName [0 ]) {
259
+ switch (opts -> formatName [0 ]) {
255
260
256
- case 'c' :
257
- case 'C' :
258
- opts -> format = archCustom ;
259
- break ;
261
+ case 'c' :
262
+ case 'C' :
263
+ opts -> format = archCustom ;
264
+ break ;
260
265
261
- case 'f' :
262
- case 'F' :
263
- opts -> format = archFiles ;
264
- break ;
266
+ case 'f' :
267
+ case 'F' :
268
+ opts -> format = archFiles ;
269
+ break ;
265
270
266
- case 't' :
267
- case 'T' :
268
- opts -> format = archTar ;
269
- break ;
271
+ case 't' :
272
+ case 'T' :
273
+ opts -> format = archTar ;
274
+ break ;
270
275
271
- default :
272
- fprintf (stderr , "%s: Unknown archive format '%s', please specify 't' or 'c'\n" ,
273
- progname , opts -> formatName );
274
- exit (1 );
275
- }
276
- }
276
+ default :
277
+ fprintf (stderr , "%s: Unknown archive format '%s', please specify 't' or 'c'\n" ,
278
+ progname , opts -> formatName );
279
+ exit (1 );
280
+ }
281
+ }
277
282
278
283
AH = OpenArchive (fileSpec , opts -> format );
279
284
@@ -329,6 +334,8 @@ static void usage(const char *progname)
329
334
" -h, --host HOSTNAME server host name\n"
330
335
" -i, --index[=NAME] dump indexes or named index\n"
331
336
" -l, --list dump summarized TOC for this file\n"
337
+ " -L, --use-list=FILENAME use specified table of contents for ordering\n"
338
+ " output from this file\n"
332
339
" -N, --orig-order dump in original dump order\n"
333
340
" -o, --oid-order dump in oid order\n"
334
341
" -O, --no-owner do not output reconnect to database to match\n"
@@ -343,8 +350,6 @@ static void usage(const char *progname)
343
350
" -t [TABLE], --table[=TABLE] dump for this table only\n"
344
351
" -T, --trigger[=NAME] dump triggers or named trigger\n"
345
352
" -u, --password use password authentication\n"
346
- " -U, --use-list=FILENAME use specified table of contents for ordering\n"
347
- " output from this file\n"
348
353
" -v, --verbose verbose\n"
349
354
" -x, --no-acl skip dumping of ACLs (grant/revoke)\n" );
350
355
@@ -360,6 +365,8 @@ static void usage(const char *progname)
360
365
" -h HOSTNAME server host name\n"
361
366
" -i NAME dump indexes or named index\n"
362
367
" -l dump summarized TOC for this file\n"
368
+ " -L FILENAME use specified table of contents for ordering\n"
369
+ " output from this file\n"
363
370
" -N dump in original dump order\n"
364
371
" -o dump in oid order\n"
365
372
" -O do not output reconnect to database to match\n"
@@ -374,8 +381,6 @@ static void usage(const char *progname)
374
381
" -t NAME dump for this table only\n"
375
382
" -T NAME dump triggers or named trigger\n"
376
383
" -u use password authentication\n"
377
- " -U FILENAME use specified table of contents for ordering\n"
378
- " output from this file\n"
379
384
" -v verbose\n"
380
385
" -x skip dumping of ACLs (grant/revoke)\n" );
381
386
#endif
0 commit comments