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