1 write to CommandResult
System.CommandLine (1)
ParseResult.cs (1)
39CommandResult = commandResult;
65 references to CommandResult
aspire (12)
Commands\GroupedHelpAction.cs (1)
20if (parseResult.CommandResult.Command == rootCommand)
Commands\NewCommand.cs (3)
299if (parseResult.CommandResult.Command != this) 301var subcommandTemplate = availableTemplates.SingleOrDefault(t => t.Name.Equals(parseResult.CommandResult.Command.Name, StringComparison.OrdinalIgnoreCase)); 309InteractionService.DisplayError($"Template '{parseResult.CommandResult.Command.Name}' is not available. Ensure the required runtime is installed.");
Commands\ParseResultHelper.cs (3)
172CommandLineCommandResult? commandResult = parseResult.CommandResult; 210CommandLineCommandResult? commandResult = parseResult.CommandResult; 346var current = parseResult.CommandResult.Parent;
Commands\ResourceCommand.cs (1)
637WriteResourceCommandHelp(parseResult.InvocationConfiguration.Output, parseResult.CommandResult, request.ResourceName, resourceCommand);
Completions\CompletionInvocation.cs (1)
105for (var commandResult = parseResult.CommandResult; commandResult is not null; commandResult = commandResult.Parent as System.CommandLine.Parsing.CommandResult)
Program.cs (3)
1119InitializeCommandTelemetry(parseResult.CommandResult.Command, telemetryManager, 1319var parentNames = new List<string> { r.CommandResult.Command.Name }; 1320var current = r.CommandResult.Parent;
Aspire.Cli.Tests (4)
Commands\AgentTelemetryCommandTests.cs (4)
37Program.InitializeCommandTelemetry(result.CommandResult.Command, manager, fixture.Telemetry); 72Program.InitializeCommandTelemetry(result.CommandResult.Command, manager, fixture.Telemetry); 113Program.InitializeCommandTelemetry(result.CommandResult.Command, manager, fixture.Telemetry); 136var command = provider.GetRequiredService<RootCommand>().Parse(["doctor"]).CommandResult.Command;
crossgen2 (2)
parent\parent\Common\CommandLineHelpers.cs (2)
237foreach (Option option in res.CommandResult.Command.Options) 294foreach (Argument argument in res.CommandResult.Command.Arguments)
dotnet-aot (24)
parent\dotnet\CliSchema.cs (1)
82var command = parseResult.CommandResult.Command;
parent\dotnet\CommandBase.cs (1)
30protected TDefinition Definition { get; } = (TDefinition)parseResult.CommandResult.Command;
parent\dotnet\CommandInvocation.cs (1)
56var commandResult = parseResult.CommandResult;
parent\dotnet\Commands\Run\AotRunCommand.cs (2)
55var definition = (RunCommandDefinition)parseResult.CommandResult.Command; 429=> parseResult.CommandResult.Children
parent\dotnet\Commands\Test\AotTestCommand.cs (2)
29if (parseResult.CommandResult.Command is not TestCommandDefinition.MicrosoftTestingPlatform definition 68=> parseResult.CommandResult.Children
parent\dotnet\Commands\Test\MTP\MicrosoftTestingPlatformTestCommand.cs (3)
39var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.Command; 1006var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.Command; 1193var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.Command;
parent\dotnet\Commands\Test\MTP\TestCommandOptions.cs (1)
19var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.Command;
parent\dotnet\Commands\Test\MTP\TestModulesFilterHandler.cs (1)
26var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.Command;
parent\dotnet\Extensions\ParseResultExtensions.cs (6)
24parseResult.CommandResult.Command.Equals(Parser.RootCommand) && string.IsNullOrEmpty(parseResult.RootSubCommandResult()); 38parseResult.CommandResult.Command.Equals(Parser.RootCommand) 154if (parseResult.CommandResult.Command.TreatUnmatchedTokensAsErrors 217var propertyOptions = parseResult.CommandResult.Children.Where(c => GetOptionTokenOrDefault(c)?.Value.Equals(optionString) ?? false); 246List<string> parentNames = [parseResult.CommandResult.Command.Name]; 247var current = parseResult.CommandResult.Parent;
parent\dotnet\FirstRunExperience.cs (2)
76if (parseResult.CommandResult.Command is InternalReportInstallSuccessCommandDefinition) 86var skipFirstTimeUseCheck = parseResult.CommandResult.Tokens.Any(t =>
parent\dotnet\Parser.cs (1)
291for (System.CommandLine.Parsing.SymbolResult? result = parseResult.CommandResult; result is not null; result = result.Parent)
parent\dotnet\ParserOptionActions.cs (1)
104var command = parseResult.CommandResult.Command;
parent\dotnet\Telemetry\TelemetryFilter.cs (2)
88parseResult.CommandResult.Command != null && 89parseResult.CommandResult.Command.Name == "update")
dotnet-watch (2)
CommandLine\CommandLineOptions.cs (2)
211var definition = (DotnetWatchCommandDefinition)parseResult.CommandResult.Command; 217foreach (var child in parseResult.CommandResult.Children)
ilc (2)
parent\parent\Common\CommandLineHelpers.cs (2)
237foreach (Option option in res.CommandResult.Command.Options) 294foreach (Argument argument in res.CommandResult.Command.Arguments)
Microsoft.DotNet.Cli.CommandLine (1)
ForwardedOptionExtensions.cs (1)
208=> parseResult.OptionValuesToBeForwarded((command ?? parseResult.CommandResult.Command).Options);
Microsoft.TemplateEngine.Cli (13)
Commands\BaseCommand.cs (1)
121string usedCommandAlias = args.ParseResult.CommandResult.IdentifierToken.Value;
Commands\BaseFilterableArgs.cs (1)
47var filterableCommand = (IFilterableCommand)parseResult.CommandResult.Command;
Commands\create\InstantiateCommandArgs.cs (3)
40foreach (OptionResult optionResult in parseResult.CommandResult.Children.OfType<OptionResult>()) 57Debug.Assert(parseResult.CommandResult.Command is NewCommand); 71public Command NewOrInstantiateCommand => ParseResult.CommandResult.Command;
Commands\Example.cs (3)
14var commandResult = parseResult.CommandResult; 35T siblingCommand = SearchForSiblingCommand<T>(parseResult.CommandResult.Command); 79return new Example<T>((T)parseResult.CommandResult.Command, [.. commandParts]);
Commands\GlobalArgs.cs (2)
25HasHelpOption = parseResult.CommandResult.Children.Any(child => child is OptionResult optionResult && optionResult.Option is HelpOption); 56var commandResult = parseResult.CommandResult;
Commands\NewCommand.Help.cs (1)
15if (context.ParseResult.CommandResult.Command is not NewCommand newCommand)
Commands\NewCommandArgs.cs (1)
25foreach (var childrenResult in parseResult.CommandResult.Children)
Commands\update\UpdateCommandArgs.cs (1)
13var definition = ((IUpdateCommand)parseResult.CommandResult.Command).Definition;
System.CommandLine (5)
Help\HelpAction.cs (1)
61parseResult.CommandResult.Command,
Invocation\ParseErrorAction.cs (2)
69.CommandResult 97foreach (string suggestion in GetPossibleTokens(parseResult.CommandResult, token))
ParseResult.cs (2)
335public CommandLineAction? Action => _action ?? CommandResult.Command.Action; 341var commandResult = CommandResult;