diff --git a/Core/NetArgumentParser/src/Options/Exceptions/OptionValueNotSatisfyChoicesException.cs b/Core/NetArgumentParser/src/Options/Exceptions/OptionValueNotSatisfyChoicesException.cs index 0670633..f018a62 100644 --- a/Core/NetArgumentParser/src/Options/Exceptions/OptionValueNotSatisfyChoicesException.cs +++ b/Core/NetArgumentParser/src/Options/Exceptions/OptionValueNotSatisfyChoicesException.cs @@ -71,6 +71,6 @@ private static string GetDefaultMessage(string[] optionValue, string[] allowedVa string allowedValuesPresenter = string.Join(", ", allowedValues); return $"Option value '{optionValuePresenter}' not allowed. " + - $"It must be one of [{allowedValuesPresenter}]."; + "It must be one of {" + allowedValuesPresenter + "}."; } } diff --git a/Core/NetArgumentParser/src/Options/Utils/Verifiers/OptionNameCorrectnessVerifier.cs b/Core/NetArgumentParser/src/Options/Utils/Verifiers/OptionNameCorrectnessVerifier.cs index 5f9cf23..0adbbe8 100644 --- a/Core/NetArgumentParser/src/Options/Utils/Verifiers/OptionNameCorrectnessVerifier.cs +++ b/Core/NetArgumentParser/src/Options/Utils/Verifiers/OptionNameCorrectnessVerifier.cs @@ -7,7 +7,7 @@ namespace NetArgumentParser.Options.Utils.Verifiers; internal static partial class OptionNameCorrectnessVerifier { - private static readonly List _specialNames = [ "?" ]; + private static readonly List _reservedNames = [ "?" ]; internal static void VerifyAtLeastOneNameIsDefined(string longName, string shortName) { @@ -26,7 +26,7 @@ internal static void VerifyNameIsCorrect(string name) ArgumentNullException.ThrowIfNull(name, nameof(name)); if (!string.IsNullOrEmpty(name) - && !_specialNames.Contains(name) + && !_reservedNames.Contains(name) && !CorrectNameRegex().IsMatch(name)) { throw new IncorrectOptionNameException(null, name); diff --git a/Tests/NetArgumentParser.Tests/src/ArgumentParserTests.cs b/Tests/NetArgumentParser.Tests/src/ArgumentParserTests.cs index 70f04be..6d65124 100644 --- a/Tests/NetArgumentParser.Tests/src/ArgumentParserTests.cs +++ b/Tests/NetArgumentParser.Tests/src/ArgumentParserTests.cs @@ -1660,8 +1660,8 @@ private static void VerifyExtraArguments( ArgumentNullException.ThrowIfNull(actual, nameof(expected)); ArgumentNullException.ThrowIfNull(actual, nameof(actual)); - expected = expected.OrderBy(t => t); - actual = actual.OrderBy(t => t); + expected = expected.Order(); + actual = actual.Order(); Assert.True(expected.SequenceEqual(actual)); }