1 override of AddError
System.CommandLine (1)
Parsing\ArgumentResult.cs (1)
145
public override void
AddError
(string errorMessage)
35 references to AddError
aspire (9)
Commands\BaseCommand.cs (1)
317
result.
AddError
(string.Format(CultureInfo.CurrentCulture, SharedCommandStrings.NonInteractiveRequiresYesFormat, command.Name));
Commands\DoCommand.cs (1)
51
result.
AddError
(DoCommandStrings.StepArgumentRequired);
Commands\LsCommand.cs (1)
66
result.
AddError
(SharedCommandStrings.LsStreamRequiresJson);
Commands\ResourceCommand.cs (6)
103
result.
AddError
(string.Format(CultureInfo.CurrentCulture, ResourceCommandStrings.ArgumentRequired, s_resourceArgument.Name));
110
result.
AddError
(string.Format(CultureInfo.CurrentCulture, ResourceCommandStrings.ArgumentRequired, s_commandArgument.Name));
303
result.
AddError
($"Required option '{missingRequiredOptions[0]}' was not provided.");
307
result.
AddError
($"Required options were not provided: {string.Join(", ", missingRequiredOptions.Select(static optionName => $"'{optionName}'"))}.");
428
result.
AddError
($"Option '--{optionName}' only accepts the following values: {string.Join(", ", options.Keys)}.");
439
result.
AddError
($"Option '--{optionName}' is disabled.");
Aspire.TerminalHost (3)
TerminalHostArgs.cs (3)
83
r.
AddError
("--columns must be >= 1.");
93
r.
AddError
("--rows must be >= 1.");
165
r.
AddError
($"{name} may only be specified once.");
dotnet-format (3)
Commands\FormatWhitespaceCommand.cs (3)
36
symbolResult.
AddError
(Resources.Cannot_specify_the_folder_option_with_no_restore);
46
symbolResult.
AddError
(Resources.Cannot_specify_the_folder_option_when_writing_a_binary_log);
56
symbolResult.
AddError
(Resources.Cannot_specify_the_folder_option_with_framework);
dotnet-sourcelink (1)
Program.cs (1)
153
commandResult.
AddError
("Specify --user and --password options");
dotnet-watch (3)
CommandLine\DotnetWatchCommandDefinition.cs (3)
104
v.
AddError
(string.Format(Resources.Cannot_specify_both_0_and_1_options, QuietOption.Name, VerboseOption.Name));
112
v.
AddError
(string.Format(Resources.Cannot_specify_both_0_and_1_options, LongProjectOption.Name, ShortProjectOption.Name));
117
v.
AddError
(string.Format(
Microsoft.DotNet.Cli.Definitions (11)
Commands\New\CommandDefinitionExtensions.cs (2)
83
commandResult.
AddError
(string.Format(CommandDefinitionStrings.Commands_Validator_WrongTokens, string.Join(",", wrongTokens)));
110
commandResult.
AddError
(string.Format(CommandDefinitionStrings.Commands_Validator_WrongTokens, string.Join(",", wrongTokens)));
Commands\Package\PackageAddCommandDefinition.cs (1)
77
result.
AddError
(CommandDefinitionStrings.ValidationFailedDuplicateVersion);
Commands\Test\TestCommandDefinition.MicrosoftTestingPlatform.cs (5)
280
commandResult.
AddError
(string.Format(
286
commandResult.
AddError
(CommandDefinitionStrings.CmdAffectedTestsOptionsMutuallyExclusive);
290
commandResult.
AddError
(CommandDefinitionStrings.CmdCollectTestMapCannotRunModulesInParallel);
294
commandResult.
AddError
(CommandDefinitionStrings.CmdCollectTestMapCannotRequireMinimumTests);
308
optionResult.
AddError
(CommandDefinitionStrings.CmdTestPositiveIntegerRequired);
Commands\Workload\WorkloadCommandDefinition.cs (1)
74
commandResult.
AddError
(CommandDefinitionStrings.RequiredCommandNotPassed);
Commands\Workload\WorkloadSearchVersionsCommandDefinition.cs (2)
48
result.
AddError
(string.Format(CommandDefinitionStrings.CannotCombineSearchStringAndVersion, Parent.WorkloadIdStubArgument.Name, Name));
60
result.
AddError
(string.Format(CommandDefinitionStrings.UnrecognizedCommandOrArgument, string.Join(' ', versionArguments)));
Microsoft.TemplateEngine.Cli (2)
Commands\create\TemplateCommand.cs (1)
81
optionResult.
AddError
("Languages don't match");
Commands\Extensions.cs (1)
74
optionResult.
AddError
(string.Format(
System.CommandLine (2)
Parsing\CommandResult.cs (1)
121
optionResult.
AddError
(error.ErrorMessage!);
VersionOption.cs (1)
58
result.
AddError
(LocalizationResources.VersionOptionCannotBeCombinedWithOtherArguments(result.IdentifierToken?.Value ?? result.Option.Name));
System.CommandLine.StaticCompletions (1)
CompletionsCommandDefinition.cs (1)
34
argumentResult.
AddError
(string.Format(Strings.ShellDiscovery_ShellNotSupported, singleToken.Value, string.Join(", ", ShellNames.All)));