1 override of AddError
System.CommandLine (1)
Parsing\ArgumentResult.cs (1)
145
public override void
AddError
(string errorMessage)
43 references to AddError
aspire (12)
Commands\AgentInitCommand.cs (1)
144
result.
AddError
(string.Format(CultureInfo.CurrentCulture, AgentCommandStrings.InitCommand_InvalidScope, result.Tokens[0].Value));
Commands\BaseCommand.cs (1)
336
result.
AddError
(string.Format(CultureInfo.CurrentCulture, SharedCommandStrings.NonInteractiveRequiresYesFormat, command.Name));
Commands\DoCommand.cs (1)
52
result.
AddError
(DoCommandStrings.StepArgumentRequired);
Commands\LsCommand.cs (1)
66
result.
AddError
(SharedCommandStrings.LsStreamRequiresJson);
Commands\PsCommand.cs (1)
128
result.
AddError
(PsCommandStrings.InvalidOutputMode);
Commands\ResourceCommand.cs (6)
104
result.
AddError
(string.Format(CultureInfo.CurrentCulture, ResourceCommandStrings.ArgumentRequired, s_resourceArgument.Name));
111
result.
AddError
(string.Format(CultureInfo.CurrentCulture, ResourceCommandStrings.ArgumentRequired, s_commandArgument.Name));
304
result.
AddError
($"Required option '{missingRequiredOptions[0]}' was not provided.");
308
result.
AddError
($"Required options were not provided: {string.Join(", ", missingRequiredOptions.Select(static optionName => $"'{optionName}'"))}.");
429
result.
AddError
($"Option '--{optionName}' only accepts the following values: {string.Join(", ", options.Keys)}.");
440
result.
AddError
($"Option '--{optionName}' is disabled.");
Commands\SecretCommand.cs (1)
25
result.
AddError
(SecretCommandStrings.InvalidEnvironmentName);
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 (5)
CommandLine\DotnetWatchCommandDefinition.cs (5)
106
v.
AddError
(string.Format(Resources.Cannot_specify_both_0_and_1_options, QuietOption.Name, VerboseOption.Name));
111
v.
AddError
(string.Format(Resources.Cannot_specify_both_0_and_1_options, QuietOption.Name, TraceOption.Name));
116
v.
AddError
(string.Format(Resources.Cannot_specify_both_0_and_1_options, VerboseOption.Name, TraceOption.Name));
124
v.
AddError
(string.Format(Resources.Cannot_specify_both_0_and_1_options, LongProjectOption.Name, ShortProjectOption.Name));
129
v.
AddError
(string.Format(
Microsoft.DotNet.Cli.Definitions (12)
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 (6)
281
commandResult.
AddError
(string.Format(
287
commandResult.
AddError
(CommandDefinitionStrings.CmdAffectedTestsOptionsMutuallyExclusive);
291
commandResult.
AddError
(CommandDefinitionStrings.CmdCollectTestMapCannotRunModulesInParallel);
295
commandResult.
AddError
(CommandDefinitionStrings.CmdCollectTestMapCannotRequireMinimumTests);
300
commandResult.
AddError
(CommandDefinitionStrings.CmdTestModulesRootDirectoryRequiresTestModules);
314
optionResult.
AddError
(CommandDefinitionStrings.CmdTestPositiveIntegerRequired);
Commands\Workload\WorkloadCommandDefinition.cs (1)
74
commandResult.
AddError
(CommandDefinitionStrings.RequiredCommandNotPassed);
Commands\Workload\WorkloadSearchVersionsCommandDefinition.cs (2)
57
result.
AddError
(string.Format(CommandDefinitionStrings.CannotCombineSearchStringAndVersion, Parent.WorkloadIdStubArgument.Name, Name));
69
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(
NuGet.CommandLine.XPlat (2)
Commands\NuGet\Add\DotnetNuGetAddCommand.cs (1)
53
result.
AddError
(string.Format(
Commands\NuGet\Update\DotnetNuGetUpdateCommand.cs (1)
53
result.
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)));