ソースを参照

instantfpc: added option --skip-run

git-svn-id: trunk@19244 -
Mattias Gaertner 14 年 前
コミット
e2357b5809
1 ファイル変更11 行追加4 行削除
  1. 11 4
      utils/instantfpc/instantfpc.pas

+ 11 - 4
utils/instantfpc/instantfpc.pas

@@ -68,11 +68,13 @@ begin
   writeln;
   writeln('  --compiler=<path to compiler>');
   writeln('      Normally fpc is searched in PATH and used as compiler.');
+  writeln;
+  writeln('  --skip-run');
+  writeln('      Do not execute the program. Useful to test if script compiles.');
   Halt(0);
 end;
 
 Procedure DisplayCache;
-
 begin
   write(GetCacheDir);
   Halt(0);
@@ -88,11 +90,11 @@ var
   OutputFilename: String;
   ExeExt: String;
   E : String;
+  RunIt: boolean = true;
   
 // Return true if filename found.
   
 Function InterpretParam(p : String) : boolean;
-  
 begin
   Result:=False;
   if (P='') then exit;
@@ -115,7 +117,11 @@ begin
     delete(P,1,12);
     SetCacheDir(p);
     end 
-  else if (P<>'') and (p[1]<>'-') then 
+  else if p='--skip-run' then
+    begin
+    RunIt:=false;
+    end
+  else if (P<>'') and (p[1]<>'-') then
     begin
     Filename:=p;
     Result:=True;
@@ -182,7 +188,8 @@ begin
       Compile(CacheFilename,OutputFilename);
     end;
     // run
-    Run(OutputFilename);
+    if RunIt then
+      Run(OutputFilename);
   finally
     // memory is freed by OS, but for debugging puposes you can do it manually
     {$IFDEF IFFreeMem}