2 writes to Tokens
System.CommandLine (2)
ParseResult.cs (2)
50Tokens = tokens; 54Tokens = [];
24 references to Tokens
aspire (1)
Templating\CliTemplateFactory.EmptyTemplate.cs (1)
111var localhostTldOptionSpecified = parseResult.Tokens.Any(token =>
dotnet (13)
Commands\Hidden\Parse\ParseCommand.cs (1)
18var tokens = result.Tokens.Skip(1).Select(t => t.Value).ToArray();
Commands\Run\RunCommand.cs (3)
843parseResult.Tokens.TakeWhile(static t => t.Type != TokenType.DoubleDash) 868var argValuesBeforeDoubleDash = parseResult.Tokens 991foreach (var token in parseResult.Tokens)
Extensions\ParseResultExtensions.cs (3)
32var filteredTokenValues = parseResult.Tokens.TakeWhile(token => 101|| parseResult.Tokens.Any(token => token.Type == TokenType.Directive) 112parseResult.Tokens.Select(t => t.Value).ToArray().GetSubArguments();
Parser.cs (1)
175if (parseResult.GetValue(rootCommand.DiagOption) && parseResult.Tokens.Count == 1)
ParserOptionActions.cs (1)
47if (OptionPrecedesSubcommand(parseResult.Tokens.Select(t => t.Value), parseResult.RootSubCommandResult()))
Program.cs (2)
339List<string> otherTokens = new(parseResult.Tokens.Count - 1); 340foreach (var token in parseResult.Tokens)
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 ?? "";
dotnet-watch (4)
CommandLine\CommandLineOptions.cs (4)
261var dashDashIndex = IndexOf(parseResult.Tokens, t => t.Value == "--"); 262var unmatchedTokensBeforeDashDash = parseResult.UnmatchedTokens.Count - (dashDashIndex >= 0 ? parseResult.Tokens.Count - dashDashIndex - 1 : 0); 334var dashDashIndex = IndexOf(parseResult.Tokens, t => t.Value == "--"); 335var unmatchedTokensBeforeDashDash = parseResult.UnmatchedTokens.Count - (dashDashIndex >= 0 ? parseResult.Tokens.Count - dashDashIndex - 1 : 0);
Microsoft.TemplateEngine.Cli (3)
Commands\create\InstantiateCommand.cs (1)
253args.ParseResult.Tokens.Select(t => t.Value).ToArray(),
Commands\create\InstantiateCommand.NoMatchHandling.cs (1)
146IEnumerable<string> tokens = args.ParseResult.Tokens.Select(t => $"'{t.Value}'");
Commands\Example.cs (1)
78var commandParts = parseResult.Tokens.Select(t => t.Value).Prepend(parseResult.RootCommandResult.Command.Name);
System.CommandLine (3)
Completions\CompletionAction.cs (1)
27var commandLineToComplete = parseResult.Tokens.LastOrDefault(t => t.Type != TokenType.Directive)?.Value ?? "";
Completions\CompletionContext.cs (1)
54Token? lastToken = parseResult.Tokens.LastOrDefault(t => t.Type != TokenType.Directive);
ParseResult.cs (1)
393var tokenToComplete = parseResult.Tokens.Last(t => t.Value == textCompletionContext.WordToComplete);