Skip to content

Commit 2010294

Browse files
committed
Fix HasLongName and HasShortName so they display the correct error messages
1 parent a7693ee commit 2010294

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

CommandLineParser/Core/CommandLineOptionBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public object DefaultValue
4545
public string Description { get; protected set; }
4646
public bool IsRequired { get; protected set; }
4747
public bool HasDefault { get; protected set; }
48-
public bool HasShortName => !string.IsNullOrWhiteSpace(ShortName);
49-
public bool HasLongName => !string.IsNullOrWhiteSpace(LongName);
48+
public bool HasShortName => !string.IsNullOrWhiteSpace(ShortName) && !ShortName.Equals(m_parserOptions.PrefixShortOption);
49+
public bool HasLongName => !string.IsNullOrWhiteSpace(LongName) && !LongName.Equals(m_parserOptions.PrefixLongOption);
5050

5151
public bool AutoExecute { get; protected set; }
5252

0 commit comments

Comments
 (0)