Skip to content

Commit d597e08

Browse files
authored
Make user-secrets treat unmatched options as arguments (#18256)
1 parent 474d03c commit d597e08

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Tools/dotnet-user-secrets/src/CommandLineOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class CommandLineOptions
1919

2020
public static CommandLineOptions Parse(string[] args, IConsole console)
2121
{
22-
var app = new CommandLineApplication()
22+
var app = new CommandLineApplication(treatUnmatchedOptionsAsArguments: true)
2323
{
2424
Out = console.Out,
2525
Error = console.Error,

src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ public void SetSecrets(bool fromCurrentDirectory)
9393
new KeyValuePair<string, string>("key1", Guid.NewGuid().ToString()),
9494
new KeyValuePair<string, string>("Facebook:AppId", Guid.NewGuid().ToString()),
9595
new KeyValuePair<string, string>(@"key-@\/.~123!#$%^&*())-+==", @"key-@\/.~123!#$%^&*())-+=="),
96-
new KeyValuePair<string, string>("key2", string.Empty)
96+
new KeyValuePair<string, string>("key2", string.Empty),
97+
new KeyValuePair<string, string>("-oneDashedKey", "-oneDashedValue"),
98+
new KeyValuePair<string, string>("--twoDashedKey", "--twoDashedValue")
9799
};
98100

99101
var projectPath = _fixture.GetTempSecretProject();

0 commit comments

Comments
 (0)