mirror of https://gitlab.com/basile.b/dexed.git
added <CPN and <CPFS> symbolic strings
This commit is contained in:
parent
02337b060b
commit
66a5d9f0e2
|
@ -6,9 +6,10 @@ import std.getopt;
|
|||
/*
|
||||
pass:
|
||||
|
||||
--a=<CPF> --b=<CPP> --c=<CPR> --d=<CFF> --e=<CFP> --f=<CI> --g=<CAF> --h=<CAP>
|
||||
--a=<CPF> --b=<CPP> --c=<CPR> --d=<CFF> --e=<CFP> --f=<CI> --g=<CAF> --h=<CAP> --j=<CPN> --k=<CPFS>
|
||||
|
||||
as parameters in "Run, Compile and Run file..."
|
||||
<CPFS>: only the first item is displayed but the symbol is expanded as expected.
|
||||
*/
|
||||
void main(string args[])
|
||||
{
|
||||
|
|
|
@ -88,7 +88,7 @@ begin
|
|||
proc.Parameters.Clear;
|
||||
for i:= 0 to fParameters.Count-1 do
|
||||
if fParameters.Strings[i] <> '' then
|
||||
proc.Parameters.Add(CEMainForm.expandSymbolicString(fParameters.Strings[i]));
|
||||
proc.Parameters.AddText(CEMainForm.expandSymbolicString(fParameters.Strings[i]));
|
||||
proc.Options := proc.Options - [poUsePipes, poWaitOnExit];
|
||||
proc.Execute;
|
||||
finally
|
||||
|
|
|
@ -920,7 +920,7 @@ begin
|
|||
str2 := '-' + str1
|
||||
else
|
||||
str2 := str1;
|
||||
aList.Add(CEMainForm.expandSymbolicString(str2));
|
||||
aList.AddText(CEMainForm.expandSymbolicString(str2));
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
|
@ -1268,7 +1268,7 @@ var
|
|||
dmdproc: TProcess;
|
||||
ppproc: TProcess;
|
||||
olddir, prjpath, ppname: string;
|
||||
i: NativeInt;
|
||||
i, j: NativeInt;
|
||||
begin
|
||||
|
||||
fMesgWidg.ClearAllMessages;
|
||||
|
@ -1283,8 +1283,11 @@ begin
|
|||
try
|
||||
preBuildProcess.setProcess(ppproc);
|
||||
ppproc.Executable := ppname;
|
||||
for i:= 0 to ppproc.Parameters.Count-1 do
|
||||
ppproc.Parameters.Strings[i] := expandSymbolicString(ppproc.Parameters.Strings[i]);
|
||||
j := ppproc.Parameters.Count-1;
|
||||
for i:= 0 to j do
|
||||
ppproc.Parameters.AddText(expandSymbolicString(ppproc.Parameters.Strings[i]));
|
||||
for i:= 0 to j do
|
||||
ppproc.Parameters.Delete(0);
|
||||
if ppproc.CurrentDirectory = '' then
|
||||
ppproc.CurrentDirectory := extractFilePath(ppproc.Executable);
|
||||
ppproc.Execute;
|
||||
|
@ -1342,8 +1345,11 @@ begin
|
|||
try
|
||||
postBuildProcess.setProcess(ppproc);
|
||||
ppproc.Executable := ppname;
|
||||
for i:= 0 to ppproc.Parameters.Count-1 do
|
||||
ppproc.Parameters.Strings[i] := expandSymbolicString(ppproc.Parameters.Strings[i]);
|
||||
j := ppproc.Parameters.Count-1;
|
||||
for i:= 0 to j do
|
||||
ppproc.Parameters.AddText(expandSymbolicString(ppproc.Parameters.Strings[i]));
|
||||
for i:= 0 to j do
|
||||
ppproc.Parameters.Delete(0);
|
||||
if ppproc.CurrentDirectory = '' then
|
||||
ppproc.CurrentDirectory := extractFilePath(ppproc.Executable);
|
||||
ppproc.Execute;
|
||||
|
@ -1724,7 +1730,7 @@ var
|
|||
elems: TStringList;
|
||||
elem: string;
|
||||
begs, ends: boolean;
|
||||
i: integer;
|
||||
i, j, extLen: integer;
|
||||
begin
|
||||
if symString = '' then
|
||||
exit('``');
|
||||
|
@ -1769,6 +1775,28 @@ begin
|
|||
if fileExists(fProject.fileName) then
|
||||
result += fProject.fileName;
|
||||
end;
|
||||
'CPFS', 'CurrentProjectFiles':
|
||||
begin
|
||||
if fProject <> nil then
|
||||
if fileExists(fProject.fileName) then
|
||||
for j := 0 to fProject.Sources.Count-1 do
|
||||
begin
|
||||
result += fProject.getAbsoluteSourceName(j);
|
||||
if fProject.Sources.Count > 1 then
|
||||
if j <> fProject.Sources.Count-1 then
|
||||
result += LineEnding;
|
||||
end;
|
||||
end;
|
||||
'CPN', 'CurrentProjectName':
|
||||
begin
|
||||
if fProject <> nil then
|
||||
if fileExists(fProject.fileName) then
|
||||
begin
|
||||
result += extractFileName(fProject.fileName);
|
||||
extLen := length(ExtractFileExt(result));
|
||||
result := result[1..length(result)-extLen];
|
||||
end;
|
||||
end;
|
||||
'CPP', 'CurrentProjectPath':
|
||||
begin
|
||||
if fProject <> nil then
|
||||
|
|
Loading…
Reference in New Issue