107 references to Parse
aspire (6)
Commands\AgentTelemetryCommand.cs (1)
130await RecordAsync(Parse(args[2..])).ConfigureAwait(false);
Commands\ResourceCommand.cs (1)
315var parseResult = parserCommand.Parse(capturedArguments);
Completions\CompletionInvocation.cs (1)
76return WriteCompletions(GetTokenCompletions(command.Parse(tokens)), output);
Profiling\ProfileCaptureOptions.cs (1)
53var parseResult = bootstrapCommand.Parse([.. args]);
Program.cs (2)
1192parseResult = app.Services.GetRequiredService<RootCommand>().Parse(args); 1501return await command.Parse(args).InvokeAsync(new InvocationConfiguration
Aspire.Cli.Tests (69)
Commands\AgentTelemetryCommandTests.cs (6)
35var result = provider.GetRequiredService<RootCommand>().Parse(["agent", "telemetry", "--hook"]); 71var result = provider.GetRequiredService<RootCommand>().Parse(["agent", "telemetry", "--hook"]); 111var result = provider.GetRequiredService<RootCommand>().Parse(args); 136var command = provider.GetRequiredService<RootCommand>().Parse(["doctor"]).CommandResult.Command; 263var result = command.Parse(["agent", "telemetry", "--event-type", "reference_file_read", "--file-reference", fileReference]); 318var result = command.Parse(["agent", "telemetry", "--event-type", "not_a_real_event", "--skill-name", "bad name", "--file-reference", "/etc/passwd"]);
Commands\CompletionsCommandTests.cs (4)
33var result = await command.Parse(["completions", "script", shell]) 98Assert.NotEmpty(command.Parse(["--start-debug-session", "run"]).Errors); 112var result = await command.Parse(["completions", "script", shell]) 372var expectedExitCode = await command.Parse(args).InvokeAsync(new InvocationConfiguration { Output = expected, Error = error }).DefaultTimeout();
Commands\ParseResultHelperTests.cs (26)
101var parseResult = _command.Parse(commandLine); 114var parseResult = _command.Parse(["run", "--capture-profile-output", relativePath]); 126var parseResult = _command.Parse(["run", "--capture-profile-output", ""]); 138var parseResult = _command.Parse(["run", "--capture-profile-output=--"]); 153var parseResult = command.Parse(["test", "--value=--"]); 175var parentParseResult = command.Parse(["test", "--values=--flag"]); 183var childParseResult = command.Parse(["test", .. forwardedArguments.Tokens]); 194var parseResult = _command.Parse(["run", "-d", "--isolated"]); 208var parseResult = _command.Parse( 219var childParseResult = _command.Parse(["run", .. forwardedArguments.Tokens]); 233var parseResult = _command.Parse(["run", "--debug", "--secret", "value"]); 243var childParseResult = _command.Parse(["run", .. forwardedArguments.Tokens]); 255var parseResult = _command.Parse(["run", "--ApiKey", "sk-live-secret"]); 266var parseResult = _command.Parse(["run", "--debug", "--secret", "value"]); 276var parseResult = _command.Parse(["run", "--", "--ApiKey", "secret"]); 286var parseResult = _command.Parse(["add", "Aspire.Hosting.Redis"]); 294var parseResult = _command.Parse(["run", "--apphost", "path/to/App.csproj"]); 306var parseResult = _command.Parse(["add", "Aspire.Hosting.Redis", "--source", source]); 320var parseResult = _command.Parse(["add", "Aspire.Hosting.Redis", $"--source={source}"]); 334var parseResult = _command.Parse(["add", "Aspire.Hosting.Redis", "-s", source]); 345var parseResult = _command.Parse(["add", "Aspire.Hosting.Redis", "--source", source]); 356var parseResult = _command.Parse(["add", "Aspire.Hosting.Redis", "--source", source]); 367var parseResult = _command.Parse(["add", "Aspire.Hosting.Redis", "--source", source]); 377Assert.Equal(string.Empty, ParseResultHelper.GetLoggableArguments(_command.Parse([]))); 381Assert.Equal(string.Empty, ParseResultHelper.GetLoggableArguments(_command.Parse([_command.Name]))); 387var parseResult = _command.Parse(["run", "--apphost", "same-value", "--", "same-value"]);
Commands\ResourceCommandTests.cs (1)
752var result = command.Parse(["resource", "web-browser-automation", "click-browser", """{"selector":"#submit"}"""]);
Commands\RootCommandTests.cs (1)
258var result = command.Parse(
Commands\RunCommandTests.cs (13)
114var result = command.Parse(["run", optionName, "E2E"]); 146var result = command.Parse(["run", "--apphost", appHostFile.FullName, "--launch-profile", "E2E"]); 188var result = command.Parse(["run", "--detach", "--apphost", appHostFile.FullName, "--launch-profile", "E2E"]); 239var result = command.Parse(["run", "--apphost", appHostFile.FullName, "--launch-profile", "missing"]); 284var result = command.Parse(["run", "--apphost", appHostFile.FullName, "--launch-profile", "container"]); 320var result = command.Parse(["run", "--apphost", appHostFile.FullName, "--launch-profile", "E2E"]); 1652var result = command.Parse( 5105var result = command.Parse( 5168var result = command.Parse(["run", "--apphost", appHostFile.FullName, "--debug", "--", "--custom-arg", "value"]); 5196var result = command.Parse(["run", "--apphost", appHostFile.FullName, "--debug", "--secret", "value"]); 5206var childParseResult = command.Parse(["run", .. options.Args]); 5461var result = command.Parse(args); 5513var childParseResult = command.Parse(forwardedArguments);
Commands\SdkDumpCommandTests.cs (1)
276var result = command.Parse(["sdk", "dump", "--format", "ci", outputOption,
Commands\StartCommandTests.cs (5)
115var result = command.Parse(["start", optionName, "E2E"]); 154var result = command.Parse(["start", "--apphost", appHostFile.FullName, "--launch-profile", "E2E"]); 246var result = command.Parse( 402var result = command.Parse( 701var childParseResult = command.Parse(forwardedArguments);
Commands\StopCommandTests.cs (2)
92var exitCode = await command.Parse(arguments.ToArray()).InvokeAsync().DefaultTimeout(); 158var exitCode = await command.Parse(arguments.ToArray()).InvokeAsync().DefaultTimeout();
Commands\TelemetryLogsCommandTests.cs (1)
316var result = command.Parse(["otel", "logs", "--dashboard-url", "not a URL user:password token=secret-value"]);
Commands\TerminalTapePlayCommandTests.cs (6)
61var result = provider.GetRequiredService<RootCommand>().Parse( 85var result = provider.GetRequiredService<RootCommand>().Parse( 143var result = provider.GetRequiredService<RootCommand>().Parse( 315var result = provider.GetRequiredService<RootCommand>().Parse( 345var result = provider.GetRequiredService<RootCommand>().Parse( 370var result = provider.GetRequiredService<RootCommand>().Parse(
Commands\TrayProtocolCommandTests.cs (1)
190var exitCode = await provider.GetRequiredService<RootCommand>().Parse(arguments).InvokeAsync().DefaultTimeout();
Commands\UpdateCommandRepositoryToolsTests.cs (1)
316.Parse(["update", "--apphost", appHost, "--channel", "stable", "--yes", "--non-interactive"])
Projects\DotNetAppHostProjectTests.cs (1)
1177var parseResult = rootCommand.Parse(
Aspire.RuntimeIdentifier.Tool (1)
Program.cs (1)
72return rootCommand.Parse(args).Invoke();
Aspire.TerminalHost (1)
TerminalHostArgs.cs (1)
113var parseResult = command.Parse(args);
cdac-build-tool (1)
Program.cs (1)
18return await rootCommand.Parse(args).InvokeAsync().ConfigureAwait(true);
ConfigurationSchemaGenerator (1)
Program.cs (1)
14return await rootCommand.Parse(args).InvokeAsync().ConfigureAwait(false);
CreateLayout (1)
Program.cs (1)
120return await rootCommand.Parse(args).InvokeAsync().ConfigureAwait(false);
crossgen2 (1)
Program.cs (1)
1016.Parse(args, new()
dotnet-aot (1)
parent\dotnet\Parser.cs (1)
365public static ParseResult Parse(string[] args) => RootCommand.Parse(args, ParserConfiguration);
dotnet-format (1)
Program.cs (1)
13return await rootCommand.Parse(args).InvokeAsync(null, CancellationToken.None);
dotnet-sourcelink (1)
dotnet-suggest (1)
SuggestionDispatcher.cs (1)
106public Task<int> InvokeAsync(string[] args) => RootCommand.Parse(args).InvokeAsync(Configuration);
dotnet-watch (3)
CommandLine\CommandLineOptions.cs (2)
70var parseResult = definition.Parse(args, ParserConfiguration); 90parseResult = definition.Parse(args, ParserConfiguration);
Program.cs (1)
161var runParseResult = runCommandDefinition.Parse(options.CommandArgumentsForFileDiscovery, CommandLineOptions.ParserConfiguration);
GenerateDocumentationAndConfigFiles (1)
Program.cs (1)
260return rootCommand.Parse(args).InvokeAsync(null, CancellationToken.None);
GenerateTemplateManifest (1)
Program.cs (1)
225return await command.Parse(args).InvokeAsync().ConfigureAwait(false);
ilasm (1)
Program.cs (1)
343.Parse(normalizedArgs)
ilc (1)
Program.cs (1)
845.Parse(args, new()
Infrastructure.Tests (2)
TemplateManifest\TemplateManifestCommandTests.cs (2)
21var result = command.Parse(option is null ? arguments : 73var result = command.Parse(arguments);
Microsoft.DotNet.Cli.Definitions (1)
Help\HelpContext.cs (1)
21private static readonly Lazy<ParseResult> EmptyParseResult = new(() => new RootCommand().Parse(Array.Empty<string>()));
Microsoft.DotNet.Cli.Utils (1)
MSBuildArgs.cs (1)
111var parseResult = fakeCommand.Parse([.. forwardedAndUserFacingArgs], _analysisParsingConfiguration);
Microsoft.DotNet.MacOsPkg.Cli (1)
Program.cs (1)
31return rootCommand.Parse(args).Invoke();
Microsoft.DotNet.VersionTools.Cli (1)
Program.cs (1)
62return rootCommand.Parse(args).Invoke();
Microsoft.NET.Sdk.BlazorWebAssembly.Tool (1)
Program.cs (1)
66return rootCommand.Parse(args).Invoke();
Microsoft.NET.Sdk.StaticWebAssets.Tool (1)
Program.cs (1)
66return rootCommand.Parse(args).Invoke();
Microsoft.TemplateEngine.Cli (3)
Commands\create\InstantiateCommand.cs (2)
252ParseResult updatedParseResult = args.ParseResult.RootCommandResult.Command.Parse( 415ParseResult parseResult = parser.Parse(args.RemainingArguments ?? Array.Empty<string>(), ParserFactory.ParserConfiguration);
Commands\create\InstantiateCommand.NoMatchHandling.cs (1)
188ParseResult result = ParserFactory.CreateParser(reparseCommand).Parse(args.RemainingArguments ?? Array.Empty<string>());
NuGet.CommandLine.XPlat (1)
Program.cs (1)
170ParseResult parseResult = rootCommand.Parse(args);
SelectTests (1)
Program.cs (1)
120return rootCommand.Parse(args).Invoke();
System.CommandLine (1)
ParseResult.cs (1)
62internal static ParseResult Empty() => new RootCommand().Parse(Array.Empty<string>());
TypeScriptApiCompat (1)
Program.cs (1)
68return rootCommand.Parse(args).Invoke();