Skip to content

Commit

Permalink
improved error reporting for duplicate options
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentparrett committed Dec 10, 2019
1 parent 836b710 commit 5460325
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Src/VSoft.CommandLine.Options.pas
Original file line number Diff line number Diff line change
Expand Up @@ -556,10 +556,10 @@ function TCommandDefinition.RegisterOption<T>(const longName, shortName: string;
raise Exception.Create('Name required - use RegisterUnamed to register unamed options');

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

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

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

Expand Down

0 comments on commit 5460325

Please sign in to comment.