Add token representation to remaining arguments

Before, when adding parsed information to the IRemainingArguments.Parsed,
we used the name of the parsed option ('foo') instead of it's
representation ('--foo'). This commit fixes that.
This commit is contained in:
Patrik Svensson
2024-04-23 14:04:00 +02:00
committed by Patrik Svensson
parent 95bff47b85
commit 71f762f646
6 changed files with 22 additions and 26 deletions

View File

@@ -89,7 +89,7 @@ public sealed partial class CommandAppTests
//cat.Name.ShouldBe("Kitty"); //<-- Should normally be correct, but instead name will be added to the remaining arguments (see below).
});
result.Context.Remaining.Parsed.Count.ShouldBe(1);
result.Context.ShouldHaveRemainingArgument("name", values: new[] { "Kitty", });
result.Context.ShouldHaveRemainingArgument("--name", values: new[] { "Kitty", });
}
[Fact]