diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index e386ea6..9c09b6f 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dotnet-version: ['5.0.x'] + dotnet-version: ['6.0.x'] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index f00dbbf..da578f2 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dotnet-version: ['5.0.x'] + dotnet-version: ['6.0.x'] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c9d6043..e7fa664 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dotnet-version: ['5.0.x'] + dotnet-version: ['6.0.x'] steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index 768719e..ec9c382 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ An easily configured command line arguments parser that makes short work of turning those pesky `string[] args` into a strongly-typed configuration object. -![.net](https://img.shields.io/badge/Frameworks-.netstandard21+net50-purple) +![.net](https://img.shields.io/badge/Frameworks-.netstandard2.0+.netstandard2.1+net5.0+net6.0-purple) ![GitHub](https://img.shields.io/github/license/verticalsoftware/vertical-commandline) ![Package info](https://img.shields.io/nuget/v/vertical-commandline.svg) diff --git a/src/Vertical.CommandLine.csproj b/src/Vertical.CommandLine.csproj index 1531b03..c6eebd4 100644 --- a/src/Vertical.CommandLine.csproj +++ b/src/Vertical.CommandLine.csproj @@ -1,6 +1,6 @@  - netstandard2.0;netstandard2.1;net5.0 + netstandard2.0;netstandard2.1;net5.0;net6.0 8.0 True @@ -9,7 +9,7 @@ true Simple command line argument mapping Vertical Software contributors - 2.1.0 + 2.1.1 vertical-commandline commandline;utilities https://github.com/verticalsoftware/vertical-commandline diff --git a/src/Vertical/CommandLine/Parsing/TokenMatcher.cs b/src/Vertical/CommandLine/Parsing/TokenMatcher.cs index f4d55d8..fa29357 100644 --- a/src/Vertical/CommandLine/Parsing/TokenMatcher.cs +++ b/src/Vertical/CommandLine/Parsing/TokenMatcher.cs @@ -26,7 +26,7 @@ public sealed class TokenMatcher : ITokenMatcher private static readonly string CompactShortOptionPattern = $"^-(?<{TemplateIdGroup}>[0-9a-zA-Z]+)$"; private static readonly string LongOptionPattern = $"^--(?<{TemplateIdGroup}>[\\w-]+)$"; private static readonly string WordPattern = $"^(?![\\W])(?<{TemplateIdGroup}>[0-9a-zA-Z-]+)$"; - private static readonly string CompositeOptionPattern = $"^--?(?<{TemplateIdGroup}>[0-9a-zA-Z]+)[=:](?<{OperandGroup}>.+)?$"; + private static readonly string CompositeOptionPattern = $"^--?(?<{TemplateIdGroup}>[\\w-]+)[=:](?<{OperandGroup}>.+)?$"; private const string OptionsEndPattern = "^--$"; private const string AnyPattern = ".+"; diff --git a/test/Parsing/TokenMatcherTests.cs b/test/Parsing/TokenMatcherTests.cs index aae9ef2..176ffc5 100644 --- a/test/Parsing/TokenMatcherTests.cs +++ b/test/Parsing/TokenMatcherTests.cs @@ -37,7 +37,9 @@ public void PositiveMatchReturnsTokens(TokenMatcher matcher, string input, Token Scenario(TokenMatcher.CompositeOption, "-a:", new[]{ new Token(TokenType.CompositeOption, "a")}), Scenario(TokenMatcher.CompositeOption, "-a=", new[]{ new Token(TokenType.CompositeOption, "a")}), Scenario(TokenMatcher.CompositeOption, "--long=", new[]{ new Token(TokenType.CompositeOption, "long")}), - Scenario(TokenMatcher.CompositeOption, "--long:", new[]{ new Token(TokenType.CompositeOption, "long")}) + Scenario(TokenMatcher.CompositeOption, "--long:", new[]{ new Token(TokenType.CompositeOption, "long")}), + Scenario(TokenMatcher.CompositeOption, "--long-with-dashes:", new[]{ new Token(TokenType.CompositeOption, "long-with-dashes")}), + Scenario(TokenMatcher.CompositeOption, "--long-with-dashes=", new[]{ new Token(TokenType.CompositeOption, "long-with-dashes")}) ); [Theory, MemberData(nameof(NegativeTheories))] diff --git a/test/Vertical.CommandLine.Tests.csproj b/test/Vertical.CommandLine.Tests.csproj index 1a443de..a035b15 100644 --- a/test/Vertical.CommandLine.Tests.csproj +++ b/test/Vertical.CommandLine.Tests.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 false true ..\assets\Vertical.CommandLine.snk