From f1958ef9a3d9803931a2806111746fb70b2621a5 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Mon, 9 Mar 2015 19:26:42 +0000 Subject: docdump: fixes parameter handling and usage help output. --- docview/src/docdump/docdump.lpr | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'docview') 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,' '); + writeln(' -h display this help'); end; var -- cgit v1.2.3-70-g09d2