Skip to content

Commit 5460325

Browse files
improved error reporting for duplicate options
1 parent 836b710 commit 5460325

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Src/VSoft.CommandLine.Options.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,10 @@ function TCommandDefinition.RegisterOption<T>(const longName, shortName: string;
556556
raise Exception.Create('Name required - use RegisterUnamed to register unamed options');
557557

558558
if FCommandDef.HasOption(LowerCase(longName)) then
559-
raise Exception.Create('Option : ' + longName + 'already registered');
559+
raise Exception.Create('Option [' + longName + '] already registered on command [' + FCommandDef.Name + ']');
560560

561561
if FCommandDef.HasOption(LowerCase(shortName)) then
562-
raise Exception.Create('Option : ' + shortName + 'already registered');
562+
raise Exception.Create('Option [' + shortName + '] already registered on command [' + FCommandDef.Name + ']');
563563

564564
result := TOptionDefinition<T>.Create(longName,shortName,Action);
565565

0 commit comments

Comments
 (0)