1 write to CommandResult
System.CommandLine (1)
ParseResult.cs (1)
39CommandResult = commandResult;
75 references to CommandResult
aspire (6)
Commands\GroupedHelpAction.cs (1)
20if (parseResult.CommandResult.Command == rootCommand)
Commands\NewCommand.cs (3)
143if (parseResult.CommandResult.Command != this) 145var subcommandTemplate = availableTemplates.SingleOrDefault(t => t.Name.Equals(parseResult.CommandResult.Command.Name, StringComparison.OrdinalIgnoreCase)); 153InteractionService.DisplayError($"Template '{parseResult.CommandResult.Command.Name}' is not available. Ensure the required runtime is installed.");
Program.cs (2)
777var parentNames = new List<string> { r.CommandResult.Command.Name }; 778var current = r.CommandResult.Parent;
crossgen2 (2)
src\runtime\src\coreclr\tools\Common\CommandLineHelpers.cs (2)
215foreach (Option option in res.CommandResult.Command.Options) 272foreach (Argument argument in res.CommandResult.Command.Arguments)
dotnet (42)
CliSchema.cs (1)
82var command = parseResult.CommandResult.Command;
CommandBase.cs (1)
34protected TDefinition Definition { get; } = (TDefinition)parseResult.CommandResult.Command;
Commands\Build\BuildCommand.cs (1)
22var definition = (BuildCommandDefinition)parseResult.CommandResult.Command;
Commands\Clean\CleanCommand.cs (1)
22var definition = (CleanCommandDefinition)result.CommandResult.Command;
Commands\Help\HelpCommand.cs (3)
23var definition = (HelpCommandDefinition)result.CommandResult.Command; 109if (parsedCommand?.CommandResult?.Command?.DocsLink is { } link) 114else if (parsedCommand?.CommandResult?.Command is NuGetDocumentedCommand ndc)
Commands\Hidden\Complete\CompleteCommand.cs (1)
54var definition = (CompleteCommandDefinition)complete.CommandResult.Command;
Commands\Hidden\InternalReportInstallSuccess\InternalReportInstallSuccessCommand.cs (1)
28var definition = (InternalReportInstallSuccessCommandDefinition)result.CommandResult.Command;
Commands\Hidden\Parse\ParseCommand.cs (1)
28var definition = (ParseCommandDefinition)reparsed.CommandResult.Command;
Commands\MSBuild\MSBuildCommand.cs (1)
34var definition = (MSBuildCommandDefinition)parseResult.CommandResult.Command;
Commands\NuGet\NuGetCommand.cs (2)
26if (parseResult.CommandResult.Command.Name == "why" 27&& parseResult.CommandResult.Command.Arguments.FirstOrDefault() is Argument<string> pathArg
Commands\Pack\PackCommand.cs (3)
32var definition = (PackCommandDefinition)parseResult.CommandResult.Command; 92var definition = (PackCommandDefinition)parseResult.CommandResult.Command; 136var definition = (PackCommandDefinition)parseResult.CommandResult.Command;
Commands\Package\Remove\PackageRemoveCommand.cs (1)
16private readonly PackageRemoveCommandDefinitionBase _definition = (PackageRemoveCommandDefinitionBase)parseResult.CommandResult.Command;
Commands\Publish\PublishCommand.cs (1)
31var definition = (PublishCommandDefinition)parseResult.CommandResult.Command;
Commands\Restore\RestoreCommand.cs (1)
22var definition = (RestoreCommandDefinition)result.CommandResult.Command;
Commands\Run\RunCommand.cs (1)
818var definition = (RunCommandDefinition)parseResult.CommandResult.Command;
Commands\Test\MTP\MicrosoftTestingPlatformTestCommand.cs (3)
17var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.Command; 69var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.Command; 117var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.Command;
Commands\Test\MTP\MSBuildUtility.cs (1)
102var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.Command;
Commands\Test\MTP\TestModulesFilterHandler.cs (1)
23var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.Command;
Commands\Test\MTP\ValidationUtility.cs (1)
42var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.Command;
Commands\Test\VSTest\TestCommand.cs (3)
81var definition = (TestCommandDefinition.VSTest)parseResult.CommandResult.Command; 153var definition = (TestCommandDefinition.VSTest)parseResult.CommandResult.Command; 196var definition = (TestCommandDefinition.VSTest)result.CommandResult.Command;
Commands\Tool\Store\StoreCommand.cs (1)
29var definition = (StoreCommandDefinition)result.CommandResult.Command;
Commands\VSTest\VSTestCommand.cs (1)
45var definition = (VSTestCommandDefinition)parseResult.CommandResult.Command;
Extensions\ParseResultExtensions.cs (5)
51if (parseResult.CommandResult.Command.TreatUnmatchedTokensAsErrors 97parseResult.CommandResult.Command.Equals(Parser.RootCommand) && string.IsNullOrEmpty(parseResult.RootSubCommandResult()); 160var propertyOptions = parseResult.CommandResult.Children.Where(c => GetOptionTokenOrDefault(c)?.Value.Equals(optionString) ?? false); 187List<string> parentNames = [parseResult.CommandResult.Command.Name]; 188var current = parseResult.CommandResult.Parent;
ParserOptionActions.cs (1)
97var command = parseResult.CommandResult.Command;
Program.cs (3)
213if (parseResult.CommandResult.Command is InternalReportInstallSuccessCommandDefinition) 230var skipFirstTimeUseCheck = parseResult.CommandResult.Tokens.Any(t => 294var commandResult = parseResult.CommandResult;
Telemetry\TelemetryFilter.cs (2)
71parseResult.CommandResult.Command != null && 72parseResult.CommandResult.Command.Name == "update")
dotnet-watch (2)
CommandLine\CommandLineOptions.cs (2)
203var definition = (DotnetWatchCommandDefinition)parseResult.CommandResult.Command; 209foreach (var child in parseResult.CommandResult.Children)
ilc (2)
src\runtime\src\coreclr\tools\Common\CommandLineHelpers.cs (2)
215foreach (Option option in res.CommandResult.Command.Options) 272foreach (Argument argument in res.CommandResult.Command.Arguments)
Microsoft.DotNet.Cli.CommandLine (3)
ForwardedOptionExtensions.cs (3)
206/// <param name="command">If not provided, uses the <see cref="ParseResult.CommandResult" />'s <see cref="CommandResult.Command"/>.</param> 208=> parseResult.OptionValuesToBeForwarded((command ?? parseResult.CommandResult.Command).Options); 213/// <param name="command">If not provided, uses the <see cref="ParseResult.CommandResult" />'s <see cref="CommandResult.Command"/>.</param>
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;