|
@@ -285,7 +285,7 @@ begin
|
|
except
|
|
except
|
|
On E : Exception do
|
|
On E : Exception do
|
|
Log(etError,Format('Error formatting message "%s" with %d arguments: %s',[Fmt,Length(Args),E.Message]));
|
|
Log(etError,Format('Error formatting message "%s" with %d arguments: %s',[Fmt,Length(Args),E.Message]));
|
|
- end
|
|
|
|
|
|
+ end
|
|
end;
|
|
end;
|
|
|
|
|
|
constructor TCustomApplication.Create(AOwner: TComponent);
|
|
constructor TCustomApplication.Create(AOwner: TComponent);
|
|
@@ -597,7 +597,7 @@ begin
|
|
If (Length(O)=0) or (O[1]<>FOptionChar) then
|
|
If (Length(O)=0) or (O[1]<>FOptionChar) then
|
|
begin
|
|
begin
|
|
If Assigned(NonOpts) then
|
|
If Assigned(NonOpts) then
|
|
- NonOpts.Add(O)
|
|
|
|
|
|
+ NonOpts.Add(O);
|
|
end
|
|
end
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
@@ -623,7 +623,7 @@ begin
|
|
If FindLongopt(O) then
|
|
If FindLongopt(O) then
|
|
begin
|
|
begin
|
|
If HaveArg then
|
|
If HaveArg then
|
|
- AddToResult(Format(SErrNoOptionAllowed,[I,O]))
|
|
|
|
|
|
+ AddToResult(Format(SErrNoOptionAllowed,[I,O]));
|
|
end
|
|
end
|
|
else
|
|
else
|
|
begin // Required argument
|
|
begin // Required argument
|
|
@@ -643,8 +643,6 @@ begin
|
|
begin
|
|
begin
|
|
HaveArg:=(I<ParamCount) and (Length(ParamStr(I+1))>0) and (ParamStr(I+1)[1]<>FOptionChar);
|
|
HaveArg:=(I<ParamCount) and (Length(ParamStr(I+1))>0) and (ParamStr(I+1)[1]<>FOptionChar);
|
|
UsedArg:=False;
|
|
UsedArg:=False;
|
|
- If HaveArg then
|
|
|
|
- OV:=Paramstr(I+1);
|
|
|
|
If Not CaseSensitiveOptions then
|
|
If Not CaseSensitiveOptions then
|
|
O:=LowerCase(O);
|
|
O:=LowerCase(O);
|
|
L:=Length(O);
|
|
L:=Length(O);
|
|
@@ -668,10 +666,11 @@ begin
|
|
end;
|
|
end;
|
|
Inc(J);
|
|
Inc(J);
|
|
end;
|
|
end;
|
|
- If HaveArg and UsedArg then
|
|
|
|
|
|
+ HaveArg:=HaveArg and UsedArg;
|
|
|
|
+ If HaveArg then
|
|
begin
|
|
begin
|
|
Inc(I); // Skip argument.
|
|
Inc(I); // Skip argument.
|
|
- O:=O[Length(O)]; // O is added to arguments !
|
|
|
|
|
|
+ OV:=Paramstr(I);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
If HaveArg and ((Result='') or AllErrors) then
|
|
If HaveArg and ((Result='') or AllErrors) then
|