|
@@ -29,9 +29,11 @@ const
|
|
|
// 1.3 compile in a separate directory, so that parallel invocations do not overwrite link.res files
|
|
|
|
|
|
|
|
|
-Procedure Usage;
|
|
|
+Procedure Usage(Err : string);
|
|
|
|
|
|
begin
|
|
|
+ if (Err<>'') then
|
|
|
+ Writeln('Error : ',Err);
|
|
|
writeln('instantfpc '+Version);
|
|
|
writeln;
|
|
|
writeln('Run pascal source files as scripts.');
|
|
@@ -76,7 +78,7 @@ begin
|
|
|
writeln;
|
|
|
writeln(' -B');
|
|
|
writeln(' Always recompile.');
|
|
|
- Halt(0);
|
|
|
+ Halt(Ord(Err<>''));
|
|
|
end;
|
|
|
|
|
|
Procedure DisplayCache;
|
|
@@ -108,7 +110,7 @@ begin
|
|
|
Halt(1);
|
|
|
end
|
|
|
else if p='-h' then
|
|
|
- usage
|
|
|
+ usage('')
|
|
|
else if p='--get-cache' then
|
|
|
DisplayCache
|
|
|
else if copy(p,1,11)='--compiler=' then
|
|
@@ -167,12 +169,8 @@ begin
|
|
|
end;
|
|
|
end;
|
|
|
if (Filename='') then
|
|
|
- begin
|
|
|
- writeln('missing source file');
|
|
|
- Halt(1);
|
|
|
- end;
|
|
|
+ Usage('Missing source file');
|
|
|
CheckSourceName(Filename);
|
|
|
-
|
|
|
Src:=TStringList.Create;
|
|
|
try
|
|
|
Src.LoadFromFile(Filename);
|