From 726c10a3993dd099ce403881777bd74a5fe7fc94 Mon Sep 17 00:00:00 2001 From: Mayuki Sawatari Date: Fri, 7 Jan 2022 02:22:35 +0900 Subject: [PATCH] Use UnwrappedOptionType instead --- src/Cocona.Core/CommandLine/CoconaCommandLineParser.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cocona.Core/CommandLine/CoconaCommandLineParser.cs b/src/Cocona.Core/CommandLine/CoconaCommandLineParser.cs index 5790602..f8dec3f 100644 --- a/src/Cocona.Core/CommandLine/CoconaCommandLineParser.cs +++ b/src/Cocona.Core/CommandLine/CoconaCommandLineParser.cs @@ -88,7 +88,7 @@ public ParsedCommandLine ParseCommand(IReadOnlyList 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) @@ -130,7 +130,7 @@ public ParsedCommandLine ParseCommand(IReadOnlyList 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)); @@ -179,7 +179,7 @@ public ParsedCommandLine ParseCommand(IReadOnlyList 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));