1 write to Command
System.CommandLine (1)
Parsing\CommandResult.cs (1)
21
Command
= command ?? throw new ArgumentNullException(nameof(command));
103 references to Command
aspire (6)
Commands\GroupedHelpAction.cs (1)
20
if (parseResult.CommandResult.
Command
== rootCommand)
Commands\NewCommand.cs (3)
143
if (parseResult.CommandResult.
Command
!= this)
145
var subcommandTemplate = availableTemplates.SingleOrDefault(t => t.Name.Equals(parseResult.CommandResult.
Command
.Name, StringComparison.OrdinalIgnoreCase));
153
InteractionService.DisplayError($"Template '{parseResult.CommandResult.
Command
.Name}' is not available. Ensure the required runtime is installed.");
Program.cs (2)
777
var parentNames = new List<string> { r.CommandResult.
Command
.Name };
781
parentNames.Add(parentCommandResult.
Command
.Name);
crossgen2 (2)
src\runtime\src\coreclr\tools\Common\CommandLineHelpers.cs (2)
215
foreach (Option option in res.CommandResult.
Command
.Options)
272
foreach (Argument argument in res.CommandResult.
Command
.Arguments)
dotnet (43)
CliSchema.cs (1)
82
var command = parseResult.CommandResult.
Command
;
CommandBase.cs (1)
34
protected TDefinition Definition { get; } = (TDefinition)parseResult.CommandResult.
Command
;
Commands\Build\BuildCommand.cs (1)
22
var definition = (BuildCommandDefinition)parseResult.CommandResult.
Command
;
Commands\Clean\CleanCommand.cs (1)
22
var definition = (CleanCommandDefinition)result.CommandResult.
Command
;
Commands\Help\HelpCommand.cs (3)
23
var definition = (HelpCommandDefinition)result.CommandResult.
Command
;
109
if (parsedCommand?.CommandResult?.
Command
?.DocsLink is { } link)
114
else if (parsedCommand?.CommandResult?.
Command
is NuGetDocumentedCommand ndc)
Commands\Hidden\Complete\CompleteCommand.cs (1)
54
var definition = (CompleteCommandDefinition)complete.CommandResult.
Command
;
Commands\Hidden\InternalReportInstallSuccess\InternalReportInstallSuccessCommand.cs (1)
28
var definition = (InternalReportInstallSuccessCommandDefinition)result.CommandResult.
Command
;
Commands\Hidden\Parse\ParseCommand.cs (1)
28
var definition = (ParseCommandDefinition)reparsed.CommandResult.
Command
;
Commands\MSBuild\MSBuildCommand.cs (1)
34
var definition = (MSBuildCommandDefinition)parseResult.CommandResult.
Command
;
Commands\NuGet\NuGetCommand.cs (2)
26
if (parseResult.CommandResult.
Command
.Name == "why"
27
&& parseResult.CommandResult.
Command
.Arguments.FirstOrDefault() is Argument<string> pathArg
Commands\Pack\PackCommand.cs (3)
32
var definition = (PackCommandDefinition)parseResult.CommandResult.
Command
;
92
var definition = (PackCommandDefinition)parseResult.CommandResult.
Command
;
136
var definition = (PackCommandDefinition)parseResult.CommandResult.
Command
;
Commands\Package\Remove\PackageRemoveCommand.cs (1)
16
private readonly PackageRemoveCommandDefinitionBase _definition = (PackageRemoveCommandDefinitionBase)parseResult.CommandResult.
Command
;
Commands\Publish\PublishCommand.cs (1)
31
var definition = (PublishCommandDefinition)parseResult.CommandResult.
Command
;
Commands\Restore\RestoreCommand.cs (1)
22
var definition = (RestoreCommandDefinition)result.CommandResult.
Command
;
Commands\Run\RunCommand.cs (1)
818
var definition = (RunCommandDefinition)parseResult.CommandResult.
Command
;
Commands\Test\MTP\MicrosoftTestingPlatformTestCommand.cs (3)
17
var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.
Command
;
69
var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.
Command
;
117
var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.
Command
;
Commands\Test\MTP\MSBuildUtility.cs (1)
102
var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.
Command
;
Commands\Test\MTP\TestModulesFilterHandler.cs (1)
23
var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.
Command
;
Commands\Test\MTP\ValidationUtility.cs (1)
42
var definition = (TestCommandDefinition.MicrosoftTestingPlatform)parseResult.CommandResult.
Command
;
Commands\Test\VSTest\TestCommand.cs (3)
81
var definition = (TestCommandDefinition.VSTest)parseResult.CommandResult.
Command
;
153
var definition = (TestCommandDefinition.VSTest)parseResult.CommandResult.
Command
;
196
var definition = (TestCommandDefinition.VSTest)result.CommandResult.
Command
;
Commands\Tool\Store\StoreCommand.cs (1)
29
var definition = (StoreCommandDefinition)result.CommandResult.
Command
;
Commands\VSTest\VSTestCommand.cs (1)
45
var definition = (VSTestCommandDefinition)parseResult.CommandResult.
Command
;
Extensions\ParseResultExtensions.cs (5)
51
if (parseResult.CommandResult.
Command
.TreatUnmatchedTokensAsErrors
97
parseResult.CommandResult.
Command
.Equals(Parser.RootCommand) && string.IsNullOrEmpty(parseResult.RootSubCommandResult());
136
CommandResult commandResult => commandResult.
Command
.Name,
187
List<string> parentNames = [parseResult.CommandResult.
Command
.Name];
191
parentNames.Add(parentCommandResult.
Command
.Name);
ParserOptionActions.cs (1)
97
var command = parseResult.CommandResult.
Command
;
Program.cs (2)
213
if (parseResult.CommandResult.
Command
is InternalReportInstallSuccessCommandDefinition)
297
if (commandResult.
Command
.Name == "new")
Telemetry\AllowListToSendFirstAppliedOptions.cs (1)
25
.Children.OfType<System.CommandLine.Parsing.CommandResult>().FirstOrDefault()?.
Command
.Name ?? null;
Telemetry\AllowListToSendFirstArgument.cs (1)
19
System.CommandLine.Parsing.CommandResult commandResult => commandResult.
Command
.Name,
Telemetry\TelemetryFilter.cs (2)
71
parseResult.CommandResult.
Command
!= null &&
72
parseResult.CommandResult.
Command
.Name == "update")
dotnet-watch (1)
CommandLine\CommandLineOptions.cs (1)
203
var definition = (DotnetWatchCommandDefinition)parseResult.CommandResult.
Command
;
ilc (2)
src\runtime\src\coreclr\tools\Common\CommandLineHelpers.cs (2)
215
foreach (Option option in res.CommandResult.
Command
.Options)
272
foreach (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 (17)
Commands\BaseFilterableArgs.cs (1)
47
var filterableCommand = (IFilterableCommand)parseResult.CommandResult.
Command
;
Commands\create\InstantiateCommand.cs (1)
252
ParseResult updatedParseResult = args.ParseResult.RootCommandResult.
Command
.Parse(
Commands\create\InstantiateCommandArgs.cs (2)
57
Debug.Assert(parseResult.CommandResult.
Command
is NewCommand);
71
public Command NewOrInstantiateCommand => ParseResult.CommandResult.
Command
;
Commands\Example.cs (8)
17
while (commandResult?.
Command
!= null && commandResult.
Command
is not T)
22
if (commandResult?.
Command
is T typedCommand)
25
while (commandResult?.
Command
!= null)
27
parentCommands.Add(commandResult.
Command
.Name);
35
T siblingCommand = SearchForSiblingCommand<T>(parseResult.CommandResult.
Command
);
78
var commandParts = parseResult.Tokens.Select(t => t.Value).Prepend(parseResult.RootCommandResult.
Command
.Name);
79
return new Example<T>((T)parseResult.CommandResult.
Command
, [.. commandParts]);
Commands\GlobalArgs.cs (3)
58
while (commandResult?.
Command
!= null && commandResult.
Command
is not NewCommand)
62
if (commandResult == null || commandResult.
Command
is not NewCommand newCommand)
Commands\NewCommand.Help.cs (1)
15
if (context.ParseResult.CommandResult.
Command
is not NewCommand newCommand)
Commands\update\UpdateCommandArgs.cs (1)
13
var definition = ((IUpdateCommand)parseResult.CommandResult.
Command
).Definition;
System.CommandLine (28)
Binding\ArgumentConversionResult.cs (1)
50
string alias = commandResult.
Command
.Name;
Completions\CompletionAction.cs (1)
29
var completionParseResult = parseResult.RootCommandResult.
Command
.Parse(commandLineToComplete, parseResult.Configuration);
Help\HelpAction.cs (1)
61
parseResult.CommandResult.
Command
,
Invocation\ParseErrorAction.cs (3)
71
.Select(r => r.
Command
.Options.OfType<HelpOption>().FirstOrDefault());
116
Command targetSymbol = commandResult.
Command
;
127
parent.
Command
.Options.Where(o => o.Recursive && !o.Hidden));
ParseResult.cs (2)
240
_ => ((CommandResult)currentSymbolResult).
Command
335
public CommandLineAction? Action => _action ?? CommandResult.
Command
.Action;
Parsing\ArgumentResult.cs (2)
98
var arguments = parent.
Command
.Arguments;
105
Argument nextArgument = parent.
Command
.Arguments[nextArgumentIndex];
Parsing\CommandResult.cs (8)
10
/// Represents a result produced when parsing a <see cref="
Command
" />.
50
if (
Command
.HasValidators)
53
for (var i = 0; i <
Command
.Validators.Count; i++)
55
Command
.Validators[i](this);
65
if (
Command
.HasOptions)
70
if (
Command
.HasArguments)
78
var options =
Command
.Options;
146
var arguments =
Command
.Arguments;
Parsing\ParseOperation.cs (8)
103
var arguments = _innermostCommandResult.
Command
.Arguments;
145
var arguments = _innermostCommandResult.
Command
.Arguments;
156
while (_innermostCommandResult.
Command
.HasArguments && currentArgumentIndex < _innermostCommandResult.
Command
.Arguments.Count)
158
Argument argument = _innermostCommandResult.
Command
.Arguments[currentArgumentIndex];
420
if (_innermostCommandResult is {
Command
: { Action: null, HasSubcommands: true } })
426
if (_innermostCommandResult is {
Command
.Action.ClearsParseErrors: true } &&
471
.Where(e => e.SymbolResult is CommandResult r && r.
Command
== command)
Parsing\SymbolResultTree.cs (2)
68
if (commandResult.
Command
.TreatUnmatchedTokensAsErrors)
70
if (commandResult != rootCommandResult && !rootCommandResult.
Command
.TreatUnmatchedTokensAsErrors)
System.CommandLine.StaticCompletions (1)
CompletionsCommandParser.cs (1)
40
var script = shell.GenerateCompletions(args.RootCommandResult.
Command
);