⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@samblackburn
Copy link

Closes #1074

Reimplementation of #1993 which went quiet in 2023 and now has a ton of merge conflicts.

AI disclaimer: I made this PR while playing with Claude Code.

While the Latin languages look correct to me, I haven't verified the other translations.

@samblackburn
Copy link
Author

@dotnet-policy-service agree company="Redgate Software Ltd"

@samblackburn samblackburn marked this pull request as ready for review January 7, 2026 14:38
[InlineData("es", $"Falta el argumento requerido para el comando: '{CommandName}'.")]
[InlineData("en-US", $"Required argument missing for command: '{CommandName}'.")]
[InlineData("es", $"Falta el argumento requerido '{ArgumentName}' para el comando: '{CommandName}'.")]
[InlineData("en-US", $"Required argument '{ArgumentName}' missing for command: '{CommandName}'.")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is probably not sufficient to test this change. It would be helpful to see additional testing where a command has multiple Argument<T> objects.

This kind of test isn't really about localization. Maybe add a test alongside this one for this case:

[Fact]
public void When_command_arguments_are_fewer_than_minimum_arity_then_an_error_is_returned()
{
var command = new Command("the-command")
{
new Argument<string[]>("arg")
{
Arity = new ArgumentArity(2, 3)
}
};
var result = command.Parse("1");
result.Errors
.Select(e => e.Message)
.Should()
.Contain(LocalizationResources.RequiredArgumentMissing(result.GetResult(command.Arguments[0])));
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review. I've added a test for multiple missing args - is that what you were looking for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When missing add name of argument for command to error message

2 participants