2 writes to Type
System.CommandLine (2)
Parsing\Token.cs (2)
19
Type
= type;
27
Type
= type;
26 references to Type
dotnet (13)
Commands\Run\RunCommand.cs (4)
843
parseResult.Tokens.TakeWhile(static t => t.
Type
!= TokenType.DoubleDash)
844
.Any(static t => t is {
Type
: TokenType.Argument, Value: "-" });
869
.TakeWhile(static t => t.
Type
!= TokenType.DoubleDash)
870
.Where(static t => t.
Type
== TokenType.Argument)
Extensions\ParseResultExtensions.cs (4)
33
token.
Type
== TokenType.Argument
34
|| token.
Type
== TokenType.Command
35
|| token.
Type
== TokenType.Directive)
101
|| parseResult.Tokens.Any(token => token.
Type
== TokenType.Directive)
Program.cs (2)
336
if (parseResult.GetResult(Parser.RootCommand.DotnetSubCommand) is { Tokens: [{
Type
: TokenType.Argument, Value: { } } unmatchedCommandOrFile] }
342
if (token.
Type
!= TokenType.Argument || token != unmatchedCommandOrFile)
Telemetry\AllowListToSendFirstArgument.cs (1)
29
.Where(t => t.
Type
.Equals(TokenType.Argument)).FirstOrDefault()?.Value ?? null;
Telemetry\AllowListToSendVerbSecondVerbFirstArgument.cs (2)
22
var secondVerb = parseResult.Tokens.Where(s => s.
Type
== TokenType.Command).Skip(1).FirstOrDefault()?.Value ?? "";
26
var firstArgument = parseResult.Tokens.FirstOrDefault(t => t.
Type
.Equals(TokenType.Argument))?.Value ?? "";
System.CommandLine (13)
Completions\CompletionAction.cs (1)
27
var commandLineToComplete = parseResult.Tokens.LastOrDefault(t => t.
Type
!= TokenType.Directive)?.Value ?? "";
Completions\CompletionContext.cs (2)
54
Token? lastToken = parseResult.Tokens.LastOrDefault(t => t.
Type
!= TokenType.Directive);
83
lastToken?.
Type
== TokenType.Argument)
Parsing\ParseOperation.cs (2)
53
currentTokenType = result ? _tokens[_index].
Type
: (TokenType)(-1);
396
if (CurrentToken.
Type
== TokenType.DoubleDash)
Parsing\StringExtensions.cs (5)
137
switch (token.
Type
)
165
subtoken.
Type
== TokenType.Option)
222
if (tokensBefore != tokenList.Count && tokenList[tokenList.Count - 1].
Type
== TokenType.Option)
232
tokenList.Add(new Token(found.Value, found.
Type
, found.Symbol, argumentIndex));
254
if (token.
Type
== TokenType.Option)
Parsing\Token.cs (3)
55
public bool Equals(Token? other) => other is not null && Value == other.Value &&
Type
== other.
Type
&& ReferenceEquals(Symbol, other.Symbol);
58
public override int GetHashCode() => Value.GetHashCode() ^ (int)
Type
;