diff --git a/applications/instantfpc/instantfpc.lpr b/applications/instantfpc/instantfpc.lpr index 55b2801f4..debb98b20 100644 --- a/applications/instantfpc/instantfpc.lpr +++ b/applications/instantfpc/instantfpc.lpr @@ -59,7 +59,7 @@ begin writeln('instantfpc -v'); writeln(' Print version and exit.'); writeln; - writeln('instantfpc [fpc compiler options] [program parameters]'); + writeln('instantfpc [compiler options] [program parameters]'); writeln(' Compiles source and runs program.'); writeln(' Source is compared with the cache. If cache is not valid then'); writeln(' source is copied to cache with the shebang line commented and'); @@ -67,6 +67,8 @@ begin writeln(' If compilation fails the fpc output is written to stdout and'); writeln(' instantfpc exits with error code 1.'); writeln(' If compilation was successful the program is executed.'); + writeln(' If the compiler options contains -B the program is always'); + writeln(' compiled.'); writeln; writeln('instantfpc --get-cache'); writeln(' Prints cache directory to stdout.'); diff --git a/applications/instantfpc/instantfptools.pas b/applications/instantfpc/instantfptools.pas index 478ad19fe..a731206a6 100644 --- a/applications/instantfpc/instantfptools.pas +++ b/applications/instantfpc/instantfptools.pas @@ -80,8 +80,15 @@ function IsCacheValid(Src: TStringList; const CachedSrcFile, CachedExeFile: string): boolean; var OldSrc: TStringList; + i: Integer; + p: String; begin Result:=false; + for i:=1 to Paramcount do begin + p:=ParamStr(i); + if (p='') or (p[1]<>'-') then break; + if p='-B' then exit; // always compile + end; if not FileExists(CachedSrcFile) then exit; if not FileExists(CachedExeFile) then exit; OldSrc:=TStringList.Create;