@@ -229,7 +229,7 @@ class function TOptionsRegistry.RegisterCommand(const name: string; const alias
229229begin
230230 cmdDef := TCommandDefImpl.Create(name ,alias, usage, description, helpString,visible);
231231 result := TCommandDefinition.Create(cmdDef);
232- FCommandDefs.Add(name .ToLower ,cmdDef);
232+ FCommandDefs.Add(LowerCase( name ) ,cmdDef);
233233end ;
234234
235235
@@ -259,7 +259,7 @@ class procedure TOptionsRegistry.Clear;
259259class function TOptionsRegistry.GetCommandByName (const name : string): ICommandDefinition;
260260begin
261261 result := nil ;
262- FCommandDefs.TryGetValue(name .ToLower, Result);
262+ FCommandDefs.TryGetValue(LowerCase( name ), Result);
263263
264264end ;
265265
@@ -280,7 +280,7 @@ class procedure TOptionsRegistry.EmumerateCommandOptions(const commandName: stri
280280var
281281 cmd : ICommandDefinition;
282282begin
283- if not FCommandDefs.TryGetValue(commandName.ToLower, cmd) then
283+ if not FCommandDefs.TryGetValue(LowerCase( commandName), cmd) then
284284 raise Exception.Create(' Unknown command : ' + commandName);
285285
286286 cmd.EmumerateCommandOptions(proc);
@@ -338,7 +338,7 @@ class procedure TOptionsRegistry.PrintUsage(const command: ICommandDefinition; c
338338 i: Integer;
339339 printOption : TConstProc<IOptionDefinition>;
340340begin
341- exeName := ChangeFileExt(ExtractFileName(ParamStr(0 )), ' ' ).ToLower( );
341+ exeName := LowerCase( ChangeFileExt(ExtractFileName(ParamStr(0 )), ' ' ));
342342 if not command.IsDefault then
343343 begin
344344 proc(' ' );
@@ -375,7 +375,7 @@ class procedure TOptionsRegistry.PrintUsage(const command: ICommandDefinition; c
375375 begin
376376 s := WrapText(opt.HelpText, sLineBreak, [' ' , ' -' , #9 , ' ,' ], maxDescW -1 );
377377
378- descStrings := s .Split([sLineBreak], TStringSplitOptions.None );
378+ descStrings := TStringUtils .Split(s, sLineBreak );
379379 for i := 0 to length(descStrings) -1 do
380380 descStrings[i] := Trim(descStrings[i]);
381381
@@ -468,7 +468,7 @@ class procedure TOptionsRegistry.PrintUsage(const proc: TConstProc<string>; cons
468468 exeName : string;
469469begin
470470 proc(' ' );
471- exeName := ChangeFileExt(ExtractFileName(ParamStr(0 )), ' ' ).ToLower( );
471+ exeName := LowerCase( ChangeFileExt(ExtractFileName(ParamStr(0 )), ' ' ));
472472
473473 // if we have more than 1 command then we are using command mode
474474 if FCommandDefs.Count > 0 then
@@ -494,7 +494,7 @@ class procedure TOptionsRegistry.PrintUsage(const proc: TConstProc<string>; cons
494494 continue;
495495
496496 s := WrapText(cmd.Description,maxDescW);
497- descStrings := s .Split([sLineBreak], TStringSplitOptions.None );
497+ descStrings := TStringUtils .Split(s, sLineBreak );
498498 proc(' ' + PadRight(cmd.Name , descriptionTab -1 ) + descStrings[0 ]);
499499 numDescStrings := Length(descStrings);
500500 if numDescStrings > 1 then
0 commit comments