From 5460325e2b066c776779d3d21939f3ba2d3385a4 Mon Sep 17 00:00:00 2001 From: Vincent Parrett Date: Tue, 10 Dec 2019 14:32:00 +1100 Subject: [PATCH] improved error reporting for duplicate options --- Src/VSoft.CommandLine.Options.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/VSoft.CommandLine.Options.pas b/Src/VSoft.CommandLine.Options.pas index 8fcf95d..842b172 100644 --- a/Src/VSoft.CommandLine.Options.pas +++ b/Src/VSoft.CommandLine.Options.pas @@ -556,10 +556,10 @@ function TCommandDefinition.RegisterOption(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.Create(longName,shortName,Action);