Skip to content

Commit

Permalink
Use UnwrappedOptionType instead
Browse files Browse the repository at this point in the history
  • Loading branch information
mayuki committed Jan 6, 2022
1 parent f80e468 commit 726c10a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Cocona.Core/CommandLine/CoconaCommandLineParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public ParsedCommandLine ParseCommand(IReadOnlyList<string> args, IReadOnlyList<
optionsCompleted = true;
}

if (optionDesc.OptionType == typeof(bool) || optionDesc.OptionType == typeof(bool?))
if (optionDesc.UnwrappedOptionType == typeof(bool))
{
// Boolean (flag)
var flag = string.Equals(partRight, "true", StringComparison.OrdinalIgnoreCase) || string.Equals(partRight, "1", StringComparison.OrdinalIgnoreCase)
Expand Down Expand Up @@ -130,7 +130,7 @@ public ParsedCommandLine ParseCommand(IReadOnlyList<string> args, IReadOnlyList<
optionsCompleted = true;
}

if (optionDesc.OptionType == typeof(bool) || optionDesc.OptionType == typeof(bool?))
if (optionDesc.UnwrappedOptionType == typeof(bool))
{
// Boolean (flag)
options.Add(new CommandOption(optionDesc, "true", i));
Expand Down Expand Up @@ -179,7 +179,7 @@ public ParsedCommandLine ParseCommand(IReadOnlyList<string> args, IReadOnlyList<
optionsCompleted = true;
}

if (optionDesc.OptionType == typeof(bool) || optionDesc.OptionType == typeof(bool?))
if (optionDesc.UnwrappedOptionType == typeof(bool))
{
// Boolean (flag)
options.Add(new CommandOption(optionDesc, "true", i));
Expand Down

0 comments on commit 726c10a

Please sign in to comment.