diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2015-03-09 19:26:42 +0000 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2015-03-09 19:26:42 +0000 |
commit | f1958ef9a3d9803931a2806111746fb70b2621a5 (patch) | |
tree | 1bbad3b32dbbe7facb9a5040bd2d71e7ae91eb27 | |
parent | 2a97afaccba24bb0866b9f05888fdf628ef1ad55 (diff) | |
download | fpGUI-f1958ef9a3d9803931a2806111746fb70b2621a5.tar.xz |
docdump: fixes parameter handling and usage help output.
-rw-r--r-- | docview/src/docdump/docdump.lpr | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/docview/src/docdump/docdump.lpr b/docview/src/docdump/docdump.lpr index a642b0c0..db2aac45 100644 --- a/docview/src/docdump/docdump.lpr +++ b/docview/src/docdump/docdump.lpr @@ -35,16 +35,8 @@ procedure TDocDump.DoRun; var ErrorMsg: String; begin - // quick check parameters - ErrorMsg:=CheckOptions('h','help'); - if ErrorMsg<>'' then begin - ShowException(Exception.Create(ErrorMsg)); - Terminate; - Exit; - end; - - // parse parameters - if HasOption('h','help') then begin + if (ParamCount = 0) or HasOption('h','help') then + begin WriteHelp; Terminate; Exit; @@ -84,7 +76,8 @@ end; procedure TDocDump.WriteHelp; begin { add your help code here } - writeln('Usage: ',ExeName,' -h'); + writeln('Usage: ',ExeName,' <INF file>'); + writeln(' -h display this help'); end; var |