Skip to content

Commit caa48c2

Browse files
authored
Merge pull request #1 from gbritton1/gbritton-FormatName-fix
Update UnParserExtensions.cs
2 parents 67f77e1 + 23bdea4 commit caa48c2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/CommandLine/UnParserExtensions.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,8 @@ private static string FormatOption(OptionSpecification spec, object value, UnPar
206206

207207
private static string FormatName(this OptionSpecification optionSpec, UnParserSettings settings)
208208
{
209-
var longName =
210-
optionSpec.LongName.Length > 0
211-
&& !settings.PreferShortName;
209+
// Short name not preferred? Go with long! No short name? Has to be long!
210+
var longName = !settings.PreferShortName || optionSpec.ShortName.Length == 0;
212211

213212
return
214213
new StringBuilder(longName

0 commit comments

Comments
 (0)