diff options
author | crupest <crupest@outlook.com> | 2024-10-16 19:33:48 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2024-10-16 19:33:48 +0800 |
commit | f7e0bf5d5514b17c4f103842b0de8313262a38a0 (patch) | |
tree | 5e9446ee5322ea0765f09cbca6018db4556b1c4c /tools | |
parent | f07d5baf89d99426c37d812c3df1fa7fdaae98a7 (diff) | |
download | crupest-f7e0bf5d5514b17c4f103842b0de8313262a38a0.tar.gz crupest-f7e0bf5d5514b17c4f103842b0de8313262a38a0.tar.bz2 crupest-f7e0bf5d5514b17c4f103842b0de8313262a38a0.zip |
fix(secret-tool): no matcher kind will not be parsed.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Crupest.SecretTool/Crupest.SecretTool/HostMatchConfig.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/Crupest.SecretTool/Crupest.SecretTool/HostMatchConfig.cs b/tools/Crupest.SecretTool/Crupest.SecretTool/HostMatchConfig.cs index 5cc0c3d..5d2c504 100644 --- a/tools/Crupest.SecretTool/Crupest.SecretTool/HostMatchConfig.cs +++ b/tools/Crupest.SecretTool/Crupest.SecretTool/HostMatchConfig.cs @@ -48,9 +48,10 @@ public class HostMatchConfig(string configString, List<HostMatchKind> allowedMat foreach (var matchKind in Enum.GetValues<HostMatchKind>()) { var matchKindName = Enum.GetName(matchKind) ?? throw new Exception("No such match kind."); - hasExplicitMatchKind = true; if (segments[0] == matchKindName) { + hasExplicitMatchKind = true; + if (segments.Count < 2) { throw new FormatException($"Explicit match item needs a value in line {lineNumber}."); |