-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refs #1074 - Error message "Required argument {ARGUMENT NAME} missing for command {commandName}..." #1993
base: main
Are you sure you want to change the base?
Refs #1074 - Error message "Required argument {ARGUMENT NAME} missing for command {commandName}..." #1993
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,11 +85,25 @@ public virtual string InvalidCharactersInFileName(char invalidChar) => | |
GetResourceString(Properties.Resources.InvalidCharactersInFileName, invalidChar); | ||
|
||
/// <summary> | ||
/// Interpolates values into a localized string similar to Required argument missing for command: {0}. | ||
/// Interpolates values into a localized string similar to | ||
/// Required argument {0} missing for command: {1}. | ||
/// or | ||
/// Required argument missing for option: {0}. | ||
/// </summary> | ||
public virtual string RequiredArgumentMissing(Argument argument, SymbolResult symbolResult) => | ||
symbolResult is CommandResult | ||
? GetResourceString(Properties.Resources.CommandRequiredArgumentMissing, argument.Name, symbolResult.Token().Value) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the development version I think this should prefer HelpName if set. |
||
: GetResourceString(Properties.Resources.OptionRequiredArgumentMissing, symbolResult.Token().Value); | ||
|
||
/// <summary> | ||
/// Interpolates values into a localized string similar to | ||
/// Required argument {0} missing for command: {1}. | ||
/// or | ||
/// Required argument missing for option: {0}. | ||
/// </summary> | ||
public virtual string RequiredArgumentMissing(SymbolResult symbolResult) => | ||
symbolResult is CommandResult | ||
? GetResourceString(Properties.Resources.CommandRequiredArgumentMissing, symbolResult.Token().Value) | ||
? GetResourceString(Properties.Resources.CommandRequiredArgumentMissing, "(unknown)", symbolResult.Token().Value) | ||
: GetResourceString(Properties.Resources.OptionRequiredArgumentMissing, symbolResult.Token().Value); | ||
Comment on lines
104
to
107
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because #2041 made LocalizationResources internal, you can just delete this overload. Then there won't be an "(unknown)" string that might have to be localised. |
||
|
||
/// <summary> | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,7 @@ | |
|
||
<ItemGroup> | ||
<InternalsVisibleTo Include="System.CommandLine.NamingConventionBinder" /> | ||
<InternalsVisibleTo Include="System.CommandLine.Tests" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's good to avoid making internals visible to tests. |
||
</ItemGroup> | ||
|
||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks unrelated. There is a similar change elsewhere in this PR.