File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -2872,6 +2872,14 @@ function Split(const Document: TDocument; var BigTOC: TElement; const Base: Ansi
28722872 SectionNames.Free();
28732873end ;
28742874
2875+ function PrintUsageAndHalt (): Boolean;
2876+ begin ;
2877+ Writeln(' syntax:' );
2878+ Writeln(' wattsi [--quiet] [--single-page-only] <source-file> <source-git-sha> <output-directory> <default-or-review> <mdn-spec-links/html.json> [<highlight-server-url>]' );
2879+ Writeln(' wattsi --version' );
2880+ Halt(1 );
2881+ end ;
2882+
28752883function Main (): Boolean;
28762884const
28772885 OtherVariants = [Low(TVariants)..High(TVariants)] - [Low(TVariants)];
@@ -2889,6 +2897,11 @@ function Main(): Boolean;
28892897 i: integer;
28902898begin
28912899 Result := False;
2900+ if (ParamCount = 0 ) then
2901+ begin
2902+ Writeln(' wattsi: missing required arguments' );
2903+ PrintUsageAndHalt();
2904+ end ;
28922905 if ((ParamCount() = 1 ) and (ParamStr(1 ) = ' --version' )) then
28932906 begin
28942907 Writeln(' wattsi ' + IntToStr(Version));
@@ -2912,10 +2925,7 @@ function Main(): Boolean;
29122925 if ((ParamCount() - i) < 4 ) then
29132926 begin
29142927 Writeln(' wattsi: invalid arguments' );
2915- Writeln(' syntax:' );
2916- Writeln(' wattsi [--quiet] [--single-page-only] <source-file> <source-git-sha> <output-directory> <default-or-review> <mdn-spec-links/html.json> [<highlight-server-url>]' );
2917- Writeln(' wattsi --version' );
2918- exit;
2928+ PrintUsageAndHalt();
29192929 end ;
29202930 SourceFile := ParamStr(i);
29212931 SourceGitSHA := ParamStr(i + 1 );
You can’t perform that action at this time.
0 commit comments