2 instantiations of CommandResult
System.CommandLine (2)
Parsing\ParseOperation.cs (2)
37
_innermostCommandResult = _rootCommandResult = new
CommandResult
(
81
_innermostCommandResult = new
CommandResult
(
71 references to CommandResult
aspire (1)
Program.cs (1)
779
while (current is
CommandResult
parentCommandResult)
dotnet (10)
CliSchema.cs (1)
15
using CommandResult = System.CommandLine.Parsing.
CommandResult
;
Extensions\ParseResultExtensions.cs (3)
11
using CommandResult = System.CommandLine.Parsing.
CommandResult
;
136
CommandResult
commandResult => commandResult.Command.Name,
189
while (current is
CommandResult
parentCommandResult)
Program.cs (3)
24
using CommandResult = System.CommandLine.Parsing.
CommandResult
;
294
var
commandResult = parseResult.CommandResult;
303
commandResult = commandResult.Parent as
CommandResult
;
Telemetry\AllowListToSendFirstAppliedOptions.cs (2)
24
.OfType<System.CommandLine.Parsing.
CommandResult
>().FirstOrDefault()?
25
.Children.OfType<System.CommandLine.Parsing.
CommandResult
>().FirstOrDefault()?.Command.Name ?? null;
Telemetry\AllowListToSendFirstArgument.cs (1)
19
System.CommandLine.Parsing.
CommandResult
commandResult => commandResult.Command.Name,
dotnet-format (3)
Commands\FormatWhitespaceCommand.cs (3)
30
internal static void EnsureFolderNotSpecifiedWithNoRestore(
CommandResult
symbolResult)
40
internal static void EnsureFolderNotSpecifiedWhenLoggingBinlog(
CommandResult
symbolResult)
50
internal static void EnsureFolderNotSpecifiedWithFramework(
CommandResult
symbolResult)
Microsoft.DotNet.Cli.CommandLine (4)
ForwardedOptionExtensions.cs (2)
206
/// <param name="command">If not provided, uses the <see cref="ParseResult.CommandResult" />'s <see cref="
CommandResult
.Command"/>.</param>
213
/// <param name="command">If not provided, uses the <see cref="ParseResult.CommandResult" />'s <see cref="
CommandResult
.Command"/>.</param>
SpanParsableExtensions.cs (2)
93
CommandResult
or null => tokenizationResult.Argument.Name,
133
CommandResult
or null => tokenizationResult.Argument.Name,
Microsoft.DotNet.Cli.Definitions (5)
Commands\New\CommandDefinitionExtensions.cs (4)
57
internal static void ValidateArgumentUsage(this
CommandResult
commandResult, params string[] argumentNames)
59
if (commandResult.Parent is not
CommandResult
parentResult)
87
internal static void ValidateOptionUsage(this
CommandResult
commandResult, string optionName)
89
if (commandResult.Parent is not
CommandResult
parentResult)
Commands\Workload\WorkloadCommandDefinition.cs (1)
72
if (commandResult.HasOption(InfoOption) && commandResult.HasOption(VersionOption) && !commandResult.Children.Any(child => child is System.CommandLine.Parsing.
CommandResult
))
Microsoft.Extensions.AI.Evaluation.Console (2)
Program.cs (2)
83
ValidateSymbolResult<
CommandResult
> requiresPathOrEndpoint = (
CommandResult
cmd) =>
Microsoft.TemplateEngine.Cli (5)
Commands\Example.cs (3)
14
var
commandResult = parseResult.CommandResult;
19
commandResult = (commandResult.Parent as
CommandResult
);
28
commandResult = (commandResult.Parent as
CommandResult
);
Commands\GlobalArgs.cs (2)
56
var
commandResult = parseResult.CommandResult;
60
commandResult = (commandResult.Parent as
CommandResult
);
System.CommandLine (41)
Binding\ArgumentConversionResult.cs (1)
48
if (argumentResult.Parent is
CommandResult
commandResult)
Binding\ArgumentConverter.cs (1)
113
if (argumentResult.Parent is
CommandResult
)
Command.cs (2)
31
private List<Action<
CommandResult
>>? _validators;
87
public List<Action<
CommandResult
>> Validators => _validators ??= new ();
Invocation\ParseErrorAction.cs (5)
70
.RecurseWhileNotNull(r => r.Parent as
CommandResult
)
114
static IEnumerable<string> GetPossibleTokens(
CommandResult
commandResult, string token)
124
for (
var
parent = commandResult.Parent as
CommandResult
; parent is not null; parent = parent.Parent as
CommandResult
)
LocalizationResources.cs (1)
56
argumentResult.Parent is
CommandResult
commandResult
ParseResult.cs (11)
19
private readonly
CommandResult
_rootCommandResult;
28
CommandResult
rootCommandResult,
29
CommandResult
commandResult,
67
public
CommandResult
CommandResult { get; }
86
public
CommandResult
RootCommandResult => _rootCommandResult;
191
public
CommandResult
? GetResult(Command command) =>
240
_ => ((
CommandResult
)currentSymbolResult).Command
253
string[] optionsWithArgumentLimitReached = currentSymbolResult is
CommandResult
commandResult
262
static string[] OptionsWithArgumentLimitReached(
CommandResult
commandResult) =>
341
var
commandResult = CommandResult;
353
if (item is
CommandResult
command)
Parsing\ArgumentResult.cs (3)
97
CommandResult
parent = (
CommandResult
)Parent!;
130
CommandResult
rootCommand = parent;
Parsing\CommandResult.cs (2)
18
CommandResult
? parent = null) :
41
public override string ToString() => $"{nameof(
CommandResult
)}: {IdentifierToken.Value} {string.Join(" ", Tokens.Select(t => t.Value))}";
Parsing\OptionResult.cs (1)
18
CommandResult
? parent = null) :
Parsing\ParseDiagramAction.cs (1)
146
builder.Append(((
CommandResult
)symbolResult).IdentifierToken.Value);
Parsing\ParseOperation.cs (6)
16
private readonly
CommandResult
_rootCommandResult;
19
private
CommandResult
_innermostCommandResult;
410
CommandResult
? currentResult = _innermostCommandResult.Parent as
CommandResult
;
415
currentResult = currentResult.Parent as
CommandResult
;
471
.Where(e => e.SymbolResult is
CommandResult
r && r.Command == command)
Parsing\SymbolResult.cs (1)
77
public
CommandResult
? GetResult(Command command) => SymbolResultTree.GetResult(command);
Parsing\SymbolResultExtensions.cs (1)
10
internal static IEnumerable<SymbolResult> AllSymbolResults(this
CommandResult
commandResult)
Parsing\SymbolResultTree.cs (4)
37
internal
CommandResult
? GetResult(Command command)
38
=> TryGetValue(command, out var result) ? (
CommandResult
)result : default;
64
internal void AddUnmatchedToken(Token token,
CommandResult
commandResult,
CommandResult
rootCommandResult)
VersionOption.cs (1)
53
if (result.Parent is
CommandResult
parent &&