浏览代码

* Merging revisions 45210 from trunk:
------------------------------------------------------------------------
r45210 | michael | 2020-05-01 16:11:14 +0200 (Fri, 01 May 2020) | 1 line

* Fix -h or --help
------------------------------------------------------------------------

git-svn-id: branches/fixes_3_2@45211 -

michael 5 年之前
父节点
当前提交
9dfaf73926
共有 1 个文件被更改,包括 12 次插入8 次删除
  1. 12 8
      utils/fpdoc/unitdiff.pp

+ 12 - 8
utils/fpdoc/unitdiff.pp

@@ -105,10 +105,10 @@ Procedure Usage;
 begin
 begin
   Writeln('Usage : ',ExtractFileName(Paramstr(0)),' [options] file1 file2');
   Writeln('Usage : ',ExtractFileName(Paramstr(0)),' [options] file1 file2');
   Writeln('Where [options] is one or more of :');
   Writeln('Where [options] is one or more of :');
+  Writeln(' -h or --help        Emit help.');
   Writeln(' --disable-arguments Do not check function arguments.');
   Writeln(' --disable-arguments Do not check function arguments.');
   Writeln(' --disable-private   Do not check class private fields.');
   Writeln(' --disable-private   Do not check class private fields.');
   Writeln(' --disable-protected Do not check class protected fields.');
   Writeln(' --disable-protected Do not check class protected fields.');
-  Writeln(' --help              Emit help.');
   Writeln(' --input=cmdline     Input file to create skeleton for.');
   Writeln(' --input=cmdline     Input file to create skeleton for.');
   Writeln('                     Use options are as for compiler.');
   Writeln('                     Use options are as for compiler.');
   Writeln(' --lang=language     Use selected language.');
   Writeln(' --lang=language     Use selected language.');
@@ -193,14 +193,18 @@ begin
     // Translate internal documentation strings
     // Translate internal documentation strings
     TranslateDocStrings(DocLang);
     TranslateDocStrings(DocLang);
     end;
     end;
-  if (cmdLineAction<>ActionHelp) and (InputFile1='') and (InputFile2='') then
-  begin
-    Writeln(StdErr,SErrNoInputFile);
-    cmdLineAction := actionHelp;
-  end else if (InputFile2='') and (CmdLineAction<>ActionList) then
+  if (cmdLineAction<>ActionHelp) then
     begin
     begin
-    Writeln(StdErr,SWarnAssumingList);
-    CmdLineAction:=ActionList;
+    if (InputFile1='') and (InputFile2='') then
+      begin
+      Writeln(StdErr,SErrNoInputFile);
+      cmdLineAction := actionHelp;
+      end
+    else if (InputFile2='') and (CmdLineAction<>ActionList) then
+      begin
+      Writeln(StdErr,SWarnAssumingList);
+      CmdLineAction:=ActionList;
+      end;
     end;
     end;
 end;
 end;