diff options
author | marco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2019-10-12 15:24:05 +0000 |
---|---|---|
committer | marco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2019-10-12 15:24:05 +0000 |
commit | 059bb922339b7803c6cb6b6005156d486657be5d (patch) | |
tree | 03b087d7f826b95859ac900f981741c8f5726557 /utils | |
parent | 713b4a7283163f19e6b8cb775d818984a0cbcf32 (diff) | |
download | fpc-059bb922339b7803c6cb6b6005156d486657be5d.tar.gz |
--- Merging r43026 into '.':
U utils/instantfpc/instantfpc.pas
--- Recording mergeinfo for merge of r43026 into '.':
U .
--- Merging r43087 into '.':
U packages/hash/src/hmac.pp
--- Recording mergeinfo for merge of r43087 into '.':
G .
--- Merging r43091 into '.':
U packages/winunits-base/src/winhttp.pp
--- Recording mergeinfo for merge of r43091 into '.':
G .
--- Merging r43095 into '.':
G packages/winunits-base/src/winhttp.pp
--- Recording mergeinfo for merge of r43095 into '.':
G .
--- Merging r43097 into '.':
U rtl/unix/dl.pp
--- Recording mergeinfo for merge of r43097 into '.':
G .
--- Merging r43098 into '.':
G packages/winunits-base/src/winhttp.pp
--- Recording mergeinfo for merge of r43098 into '.':
G .
--- Merging r43117 into '.':
U packages/chm/src/chmwriter.pas
--- Recording mergeinfo for merge of r43117 into '.':
G .
# revisions: 43026,43087,43091,43095,43097,43098,43117
git-svn-id: https://svn.freepascal.org/svn/fpc/branches/fixes_3_2@43172 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'utils')
-rw-r--r-- | utils/instantfpc/instantfpc.pas | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/utils/instantfpc/instantfpc.pas b/utils/instantfpc/instantfpc.pas index b8dd584601..fc4c6feb72 100644 --- a/utils/instantfpc/instantfpc.pas +++ b/utils/instantfpc/instantfpc.pas @@ -65,6 +65,8 @@ begin writeln; writeln('Options:'); writeln; + writeln(' --'); + Writeln(' Read program from standard input'); writeln(' --set-cache=<path to cache>'); writeln(' Set the cache to be used. Otherwise using environment variable'); writeln(' INSTANTFPCCACHE.'); @@ -95,7 +97,8 @@ var CacheDir: String; CacheFilename: String; OutputFilename: String; - E : String; + S,E : String; + DeleteCache : Boolean = False; RunIt: boolean = true; // Return true if filename found. @@ -131,6 +134,11 @@ begin begin Filename:=p; Result:=True; + end + else if (p='--') then + begin + Filename:='--'; + Result:=True; end; end; @@ -173,7 +181,18 @@ begin CheckSourceName(Filename); Src:=TStringList.Create; try - Src.LoadFromFile(Filename); + if FileName<>'--' then + Src.LoadFromFile(Filename) + else + begin + While not EOF do + begin + Readln(S); + Src.Add(S); + end; + FileName:=ChangeFileExt(GetTempFileName,'.pp'); + DeleteCache:=true; + end; CommentShebang(Src); CacheDir:=GetCacheDir; @@ -187,10 +206,14 @@ begin // save source in cache to find out next time if something changed Src.SaveToFile(CacheFilename); Compile(Filename,CacheFilename,OutputFilename); + if deleteCache then + DeleteFile(CacheFileName); end; // run if RunIt then Run(OutputFilename); + if DeleteCache then + DeleteFile(OutputFileName); finally // memory is freed by OS, but for debugging puposes you can do it manually {$IFDEF IFFreeMem} |