mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-23 04:50:51 +02:00
* Refactor: add utility routine to handle command-line changes
This commit is contained in:
parent
41a1230044
commit
68e09b35f5
@ -258,6 +258,14 @@ program fpc;
|
||||
ppccommandlinelen : longint;
|
||||
i : longint;
|
||||
errorvalue : Longint;
|
||||
|
||||
Procedure AddToCommandLine(S : String);
|
||||
|
||||
begin
|
||||
PPCCommandLine [PPCCommandLineLen] := S;
|
||||
Inc(PPCCommandLineLen);
|
||||
end;
|
||||
|
||||
begin
|
||||
setlength(ppccommandline,paramcount);
|
||||
ppccommandlinelen:=0;
|
||||
@ -269,8 +277,7 @@ program fpc;
|
||||
if ParamCount = 0 then
|
||||
begin
|
||||
SetLength (PPCCommandLine, 1);
|
||||
PPCCommandLine [PPCCommandLineLen] := '-?F' + ParamStr (0);
|
||||
Inc (PPCCommandLineLen);
|
||||
AddToCommandLine('-?F' + ParamStr (0));
|
||||
end
|
||||
else
|
||||
for i:=1 to paramcount do
|
||||
@ -305,12 +312,11 @@ program fpc;
|
||||
else
|
||||
begin
|
||||
if pos('-h',s)=1 then
|
||||
ppccommandline[ppccommandlinelen] := '-hF' + ParamStr (0)
|
||||
AddToCommandLine('-hF'+ParamStr(0))
|
||||
else if pos('-?',s)=1 then
|
||||
ppccommandline[ppccommandlinelen] := '-?F' + ParamStr (0)
|
||||
AddToCommandLine('-?F'+ParamStr(0))
|
||||
else
|
||||
ppccommandline[ppccommandlinelen]:=s;
|
||||
inc(ppccommandlinelen);
|
||||
AddToCommandLine(S);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -330,3 +336,4 @@ program fpc;
|
||||
error(ppcbin+' returned an error exitcode');
|
||||
halt(errorvalue);
|
||||
end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user