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