230 |
|
Opts := TStringList.Create; |
231 |
|
NonOpts := TStringList.Create; |
232 |
|
try |
233 |
< |
ErrorMsg := CheckOptions('aAhbeu:i:o:p:r:s:t:',['help','user','pass','role'],Opts,NonOpts); |
233 |
> |
ErrorMsg := CheckOptions('aAhbegu:i:o:p:r:s:t:',['help','user','pass','role'],Opts,NonOpts); |
234 |
|
{Database name is last parameter if given and not an option} |
235 |
|
if (NonOpts.Count > 0) and ((Opts.Count = 0) or |
236 |
|
((Opts.ValueFromIndex[Opts.Count-1] <> NonOpts[NonOpts.Count-1])) or |
237 |
< |
(ParamCount = 1) or (ParamStr(ParamCount-1)[2] in ['!','A','h','b','e']))then |
237 |
> |
(ParamCount = 1) or (ParamStr(ParamCount-1)[2] in ['!','A','h','b','e','g']))then |
238 |
|
FIBDatabase.DatabaseName := ParamStr(ParamCount); |
239 |
|
finally |
240 |
|
Opts.Free; |
272 |
|
{Process Command line options} |
273 |
|
|
274 |
|
if HasOption('a') then |
275 |
+ |
begin |
276 |
|
DoExtract := true; |
277 |
+ |
end; |
278 |
|
|
279 |
|
if HasOption('A') then |
280 |
|
begin |
294 |
|
if HasOption('i') then |
295 |
|
SQLFileName := GetOptionValue('i'); |
296 |
|
|
297 |
+ |
if HasOption('g')then |
298 |
+ |
ExtractTypes += [etGrantsToUser]; |
299 |
+ |
|
300 |
|
if HasOption('o') then |
301 |
|
begin |
302 |
|
OutputFileName := GetOptionValue('o'); |
431 |
|
writeln(stderr,'-A write database metadata and table data to stdout'); |
432 |
|
writeln(stderr,'-b stop on first error'); |
433 |
|
writeln(stderr,'-e echo sql statements to stdout'); |
434 |
+ |
writeln(stderr,'-g include grants to normal users in database metadata'); |
435 |
|
writeln(stderr,'-i <filename> execute SQL script from file'); |
436 |
|
writeln(stderr,'-h show this information'); |
437 |
|
writeln(stderr,'-o <filename> output to this file instead of stdout'); |