315 references to Parse
Aspire.Cli.Tests (312)
Commands\AddCommandTests.cs (13)
26var result = command.Parse("add --help"); 91var result = command.Parse("add"); 166var result = command.Parse("add docker"); 249var result = command.Parse("add docker --version 9.2.0"); 330var result = command.Parse("add red"); 400var result = command.Parse($"add redis --source {expectedSource}"); 439var result = command.Parse("add"); 515var result = command.Parse("add nonexistentpackage"); 740var result = command.Parse("add redis"); 808var result = command.Parse("add redis"); 913var result = command.Parse("add postgre"); 998var result = command.Parse("add sql"); 1068var result = command.Parse("add azureapp");
Commands\AgentMcpCommandTests.cs (1)
65var parseResult = rootCommand.Parse("agent mcp");
Commands\BaseCommandTests.cs (1)
32var result = command.Parse(args);
Commands\CacheCommandTests.cs (2)
21var result = command.Parse("cache"); 36var result = command.Parse("cache --help");
Commands\CertificatesCommandTests.cs (3)
20var result = command.Parse("certs --help"); 35var result = command.Parse("certs clean --help"); 50var result = command.Parse("certs trust --help");
Commands\ConfigCommandTests.cs (36)
37var result = command.Parse("config"); 51var result = command.Parse("config"); 65var result = command.Parse("config set foo bar"); 88var result = command.Parse("config set foo.bar baz"); 113var result = command.Parse("config set foo.bar.baz hello"); 143var result1 = command.Parse("config set foo primitive"); 148var result2 = command.Parse("config set foo.bar nested"); 173var setResult = command1.Parse("config set testkey testvalue"); 184var getResult = command2.Parse("config get testkey"); 199var setResult = command1.Parse("config set level1.level2.level3 nestedvalue"); 209var getResult = command2.Parse("config get level1.level2.level3"); 222var result = command.Parse("config get nonexistent.key"); 238var setResult = command.Parse("config set deletekey deletevalue"); 243var deleteResult = command.Parse("config delete deletekey"); 248var getResult = command.Parse("config get deletekey"); 263var setResult = command.Parse("config set deep.nested.value test"); 268var deleteResult = command.Parse("config delete deep.nested.value"); 292var setResult1 = command.Parse("config set flatkey flatvalue"); 296var setResult2 = command.Parse("config set nested.key nestedvalue"); 300var setResult3 = command.Parse("config set deep.nested.key deepvalue"); 305var listResult = command.Parse("config list"); 324var setResult = command.Parse("config set testkey testvalue"); 328var listResult = command.Parse("config list"); 350var setResult = command.Parse("config set testkey testvalue"); 354var listResult = command.Parse("config list --all"); 375var setResult = command.Parse($"config set {KnownFeatures.FeaturePrefix}.testFeature true"); 393var setResult = command.Parse($"config set {KnownFeatures.FeaturePrefix}.testFeature false"); 417var setResult = command.Parse($"config set {KnownFeatures.FeaturePrefix}.testFeature invalid"); 450var setResult = command.Parse($"config set {KnownFeatures.FeaturePrefix}.{KnownFeatures.ShowDeprecatedPackages} true"); 483var result = command.Parse("config set features:polyglotSupportEnabled true"); 511var result1 = command.Parse("config set features:polyglotSupportEnabled true"); 516var result2 = command.Parse("config set features.polyglotSupportEnabled false"); 542var result1 = command.Parse("config set features.polyglotSupportEnabled true"); 547var result2 = command.Parse("config set features:polyglotSupportEnabled false"); 573var setResult = command.Parse("config set features.polyglotSupportEnabled true"); 578var deleteResult = command.Parse("config delete features:polyglotSupportEnabled");
Commands\DeployCommandTests.cs (8)
27var result = command.Parse("deploy --help"); 58var result = command.Parse("deploy --apphost invalid.csproj"); 92var result = command.Parse("deploy --apphost valid.csproj"); 126var result = command.Parse("deploy --apphost valid.csproj"); 194var result = command.Parse("deploy"); 263var result = command.Parse("deploy"); 334var result = command.Parse($"deploy --output-path {testOutputPath}"); 394var result = command.Parse("deploy");
Commands\DescribeCommandTests.cs (13)
25var result = command.Parse("describe --help"); 39var result = command.Parse("describe"); 58var result = command.Parse($"describe --format {format} --help"); 76var result = command.Parse($"describe --format {format} --help"); 91var result = command.Parse("describe --format invalid"); 106var result = command.Parse("describe --follow --help"); 121var result = command.Parse("describe --watch --help"); 136var result = command.Parse("resources --help"); 151var result = command.Parse("describe --follow --format json --help"); 166var result = command.Parse("describe myresource --help"); 181var result = command.Parse("describe myresource --follow --format json --help"); 272var result = command.Parse("describe --follow --format json"); 316var result = command.Parse("describe --follow");
Commands\DoCommandTests.cs (6)
24var result = command.Parse("do --help"); 81var result = command.Parse("do my-custom-step"); 134var result = command.Parse("do deploy"); 187var result = command.Parse("do publish"); 245var result = command.Parse("do my-step --output-path test-output"); 277var result = command.Parse("do my-step --apphost invalid.csproj");
Commands\DocsCommandTests.cs (9)
24var result = command.Parse("docs"); 42var result = command.Parse("docs list"); 59var result = command.Parse("docs list --format json"); 77var result = command.Parse("docs search redis"); 95var result = command.Parse("docs search redis -n 3"); 113var result = command.Parse("docs search redis --format json"); 130var result = command.Parse("docs get redis-integration"); 147var result = command.Parse("docs get redis-integration --section \"Getting Started\""); 164var result = command.Parse("docs get nonexistent-page");
Commands\DoctorCommandTests.cs (1)
20var result = command.Parse("doctor --help");
Commands\ExecCommandTests.cs (7)
34var result = command.Parse("exec --help"); 52var result = command.Parse("exec --resource api cmd"); 70var result = command.Parse("exec --resource api cmd"); 88var result = command.Parse("exec --resource api cmd"); 109var result = command.Parse("exec --help"); 132var result = command.Parse("exec --apphost test.csproj echo hello"); 163var result = command.Parse("exec --apphost test.csproj --resource myresource --command echo");
Commands\ExportCommandTests.cs (10)
61var result = command.Parse($"export --output {outputPath}"); 133var result = command.Parse($"export --output {outputPath}"); 166var result = command.Parse($"export --apphost {appHostProjectPath} --output {outputPath}"); 281var result = command.Parse($"export --output {outputPath}"); 344var result = command.Parse($"export --output {outputPath}"); 463var result = command.Parse($"export redis --output {outputPath}"); 522var result = command.Parse($"export webfrontend --output {outputPath}"); 583var result = command.Parse($"export apiservice --output {outputPath}"); 626var result = command.Parse($"export nonexistent --output {outputPath}"); 657var result = command.Parse($"export --output {outputPath}");
Commands\ExtensionInternalCommandTests.cs (7)
36var result = command.Parse("extension --help"); 50var result = command.Parse("extension"); 71var result = command.Parse("extension get-apphosts"); 113var result = command.Parse("extension get-apphosts"); 152var result = command.Parse("extension get-apphosts"); 170var result = command.Parse("extension get-apphosts"); 184var result = command.Parse("extension get-apphosts --help");
Commands\InitCommandTests.cs (7)
52var parseResult = initCommand.Parse("init"); 104var parseResult = initCommand.Parse("init"); 203var parseResult = initCommand.Parse("init"); 285var parseResult = initCommand.Parse("init"); 381var parseResult = initCommand.Parse("init"); 513var result = command.Parse("init --channel stable"); 538var result = command.Parse("init --channel invalid-channel");
Commands\LogsCommandTests.cs (17)
24var result = command.Parse("logs --help"); 126var result = command.Parse($"logs --tail {tailValue}"); 147var result = command.Parse($"logs --tail {tailValue} --help"); 164var result = command.Parse("logs myresource"); 184var result = command.Parse($"logs --format {format} --help"); 202var result = command.Parse($"logs --format {format} --help"); 217var result = command.Parse("logs --format invalid"); 233var result = command.Parse("logs --follow --tail 50 --help"); 248var result = command.Parse("logs myresource --follow --tail 100 --format json --help"); 264var result = command.Parse("logs -f -n 10 --help"); 378var result = command.Parse("logs --format json"); 408var result = command.Parse("logs"); 435var result = command.Parse($"logs {resourceName} --format json"); 457var result = command.Parse("logs --format json --timestamps"); 495var result = command.Parse("logs --format json"); 534var result = command.Parse("logs --timestamps"); 556var result = command.Parse("logs");
Commands\McpCommandTests.cs (7)
21var result = command.Parse("mcp"); 36var result = command.Parse("mcp --help"); 50var result = command.Parse("mcp start --help"); 108var result = command.Parse("agent"); 123var result = command.Parse("agent --help"); 137var result = command.Parse("agent mcp --help"); 151var result = command.Parse("agent init --help");
Commands\NewCommandTests.cs (24)
36var result = command.Parse("new --help"); 106var result = command.Parse("new aspire-starter --use-redis-cache --test-framework None"); 163var result = command.Parse("new aspire-starter --use-redis-cache --test-framework None"); 216var result = command.Parse("new aspire-starter --name MyApp --output . --use-redis-cache --test-framework None"); 271var result = command.Parse("new aspire-starter --output notsrc --use-redis-cache --test-framework None"); 349var result = command.Parse("new aspire-starter --channel stable --use-redis-cache --test-framework None"); 426var result = command.Parse("new aspire-starter --channel stable --use-redis-cache --test-framework None"); 484var result = command.Parse("new aspire-starter --name MyApp --output . --use-redis-cache --test-framework None"); 538var result = command.Parse("new aspire-starter --name MyApp --output . --use-redis-cache --test-framework None --version 9.2.0"); 569var result = command.Parse("new"); 625var result = command.Parse("new aspire-starter --use-redis-cache --test-framework None"); 678var result = command.Parse("new aspire-starter --use-redis-cache --test-framework None"); 758var result = command.Parse("new aspire-starter --name TestApp --output ."); 836var result = command.Parse("new aspire-starter --use-redis-cache --test-framework None"); 903var result = command.Parse("new --name TestApp --output ."); 977var result = command.Parse("new --name TestApp --output ."); 1014var result = command.Parse("new aspire-empty --name TestApp --output . --localhost-tld false"); 1075var result = command.Parse("new aspire-empty --name TestApp --output ."); 1126var result = command.Parse("new aspire-ts-empty --name TestApp --output . --localhost-tld false"); 1183var result = command.Parse("new aspire-ts-empty --name TestApp --localhost-tld false"); 1278var result = command.Parse("new aspire-ts-empty --name TestApp --output ."); 1355var result = command.Parse("new aspire-ts-starter --name TestApp --output . --channel daily --localhost-tld false"); 1419var result = command.Parse("new aspire-ts-starter --name TestApp --output . --channel daily --localhost-tld false"); 1465var result = command.Parse("new aspire-empty --name TestApp --output .");
Commands\OptionWithLegacyTests.cs (2)
19var result = command.Parse("test --new-name primary-value --old-name legacy-value"); 34var result = command.Parse("test --old-name legacy-value");
Commands\PsCommandTests.cs (10)
24var result = command.Parse("ps --help"); 39var result = command.Parse("ps"); 58var result = command.Parse($"ps --format {format}"); 76var result = command.Parse($"ps --format {format}"); 91var result = command.Parse("ps --format invalid"); 141var result = command.Parse("ps --format json"); 181var result = command.Parse("ps --format json"); 247var result = command.Parse("ps --format json --resources"); 309var result = command.Parse("ps --format json"); 363var result = command.Parse("ps --resources");
Commands\PublishCommandPromptingIntegrationTests.cs (13)
49var result = command.Parse("publish"); 95var result = command.Parse("publish"); 147var result = command.Parse("publish"); 194var result = command.Parse("publish"); 240var result = command.Parse("publish"); 298var result = command.Parse("publish"); 377var result = command.Parse("publish"); 445var result = command.Parse("publish"); 497var result = command.Parse("publish"); 552var result = command.Parse("publish"); 623var result = command.Parse("publish --debug"); 667var result = command.Parse("publish"); 710var result = command.Parse("publish");
Commands\PublishCommandTests.cs (6)
24var result = command.Parse("publish --help"); 52var result = command.Parse("publish --apphost invalid.csproj"); 83var result = command.Parse("publish --apphost valid.csproj"); 114var result = command.Parse("publish --apphost valid.csproj"); 157var result = command.Parse("publish --apphost valid.csproj"); 226var result = command.Parse("publish");
Commands\ResourceCommandTests.cs (9)
21var result = command.Parse("resource --help"); 36var result = command.Parse("resource"); 51var result = command.Parse("resource myresource"); 66var result = command.Parse("resource myresource my-command --help"); 80var result = command.Parse("resource myresource my-command --apphost /path/to/project.csproj --help"); 96var startResult = command.Parse("resource myresource start --help"); 101var stopResult = command.Parse("resource myresource stop --help"); 106var restartResult = command.Parse("resource myresource restart --help"); 119var result = command.Parse("resource myresource start --apphost /path/to/project.csproj --help");
Commands\RestoreCommandTests.cs (2)
39var result = command.Parse($"restore --apphost {appHostFile.FullName}"); 74var result = command.Parse($"restore --apphost {appHostFile.FullName}");
Commands\RootCommandTests.cs (3)
23var result = command.Parse("--help"); 37var result = command.Parse("--nologo --help"); 71var result = command.Parse("--help");
Commands\RunCommandTests.cs (21)
33var result = command.Parse("run --help"); 50var result = command.Parse("run"); 67var result = command.Parse("run"); 84var result = command.Parse("run --apphost /tmp/doesnotexist.csproj"); 105var result = command.Parse("run --detach"); 126var result = command.Parse("run"); 206var result = command.Parse("run"); 326var result = command.Parse("run"); 381var result = command.Parse("run"); 451var result = command.Parse("run"); 545var result = command.Parse("run"); 615var result = command.Parse("run"); 685var result = command.Parse("run --start-debug-session"); 747var result = command.Parse("run"); 806var result = command.Parse("run"); 865var result = command.Parse("run"); 924var result = command.Parse("run"); 1329var result = command.Parse("run --no-build"); 1401var result = command.Parse("run --isolated"); 1462var result = command.Parse("run --no-build"); 1478var result = command.Parse("run -- --custom-arg value");
Commands\SdkCommandTests.cs (2)
21var result = command.Parse("sdk"); 36var result = command.Parse("sdk --help");
Commands\SdkDumpCommandTests.cs (11)
27var result = command.Parse("sdk dump --help"); 49var result = command.Parse($"sdk dump --format {format}"); 62var result = command.Parse("sdk dump /nonexistent/path/to/integration.csproj"); 77var result = command.Parse("sdk dump @13.2.0"); 92var result = command.Parse("sdk dump Aspire.Hosting.Redis@"); 107var result = command.Parse("sdk dump Aspire.Hosting.Redis@not-a-version!!!"); 122var result = command.Parse("sdk dump some-random-string"); 137var result = command.Parse("sdk dump Aspire.Hosting.Redis@13.2.0"); 150var result = command.Parse("sdk dump Aspire.Hosting.Redis@13.2.0 Aspire.Hosting.PostgreSQL@13.2.0"); 163var result = command.Parse("sdk dump Aspire.Hosting.Redis@13.2.0-preview.1"); 178var result = command.Parse("sdk dump Aspire.Hosting.Redis@@13.2.0");
Commands\SdkInstallerTests.cs (7)
46var result = command.Parse("run"); 71var result = command.Parse("add"); 94var result = command.Parse("new aspire-starter"); 133var result = command.Parse("publish"); 171var result = command.Parse("deploy"); 194var result = command.Parse("exec"); 216var result = command.Parse("run");
Commands\SecretCommandTests.cs (2)
33var result = command.Parse($"secret path --apphost \"{appHostFile.FullName}\""); 57var result = command.Parse($"secret path --apphost \"{appHostFile.FullName}\"");
Commands\StartCommandTests.cs (5)
21var result = command.Parse("start --help"); 36var result = command.Parse("start --no-build --help"); 50var result = command.Parse("start --format json --help"); 64var result = command.Parse("start --isolated --help"); 78var result = command.Parse("start -- --custom-arg value");
Commands\StopCommandTests.cs (2)
21var result = command.Parse("stop --help"); 36var result = command.Parse("stop myresource");
Commands\TelemetryCommandTests.cs (1)
24var result = command.Parse("otel");
Commands\TelemetryLogsCommandTests.cs (4)
25var result = command.Parse("otel logs"); 43var result = command.Parse($"telemetry logs --limit {limitValue}"); 69var result = command.Parse("otel logs"); 104var result = command.Parse("otel logs");
Commands\TelemetrySpansCommandTests.cs (4)
25var result = command.Parse("otel spans"); 43var result = command.Parse($"telemetry spans --limit {limitValue}"); 69var result = command.Parse("otel spans"); 104var result = command.Parse("otel spans");
Commands\TelemetryTracesCommandTests.cs (4)
25var result = command.Parse("otel traces"); 43var result = command.Parse($"telemetry traces --limit {limitValue}"); 69var result = command.Parse("otel traces"); 120var result = command.Parse("otel traces");
Commands\UpdateCommandTests.cs (18)
32var result = command.Parse("update --help"); 73var result = command.Parse($"update --apphost AppHost.csproj"); 202var result = command.Parse("update"); 275var result = command.Parse("update --apphost AppHost.csproj"); 346var result = command.Parse("update --apphost AppHost.csproj"); 393var result = command.Parse("update --self --channel daily"); 440var result = command.Parse("update --self --quality daily"); 481var result = command.Parse("update --self --channel daily"); 546var result = command.Parse("update --channel daily"); 613var result = command.Parse("update --quality daily"); 667var result = command.Parse("update --quality invalid"); 735var result = command.Parse("update --channel stable --quality daily"); 795var result = command.Parse("update"); 857var result = command.Parse("update"); 899var result = command.Parse("update --self"); 940var result = command.Parse("update --self"); 985var result = command.Parse("update --self"); 1019var result = command.Parse("update --self --channel stable");
Commands\WaitCommandTests.cs (14)
23var result = command.Parse("wait --help"); 38var result = command.Parse("wait"); 53var result = command.Parse("wait myresource --help"); 67var result = command.Parse("wait myresource --apphost /path/to/project.csproj --help"); 81var result = command.Parse("wait myresource --status up --help"); 95var result = command.Parse("wait myresource --timeout 60 --help"); 112var result = command.Parse($"wait myresource --status {status} --help"); 129var result = command.Parse($"wait myresource --status {status} --help"); 159var result = command.Parse("wait nonexistent --timeout 5"); 184var result = command.Parse("wait myapp --status up --timeout 5"); 209var result = command.Parse("wait mydb --status healthy --timeout 5"); 239var result = command.Parse("wait mydb --status healthy --timeout 2"); 264var result = command.Parse("wait worker --status down --timeout 5"); 294var result = command.Parse("wait myapp --status up --timeout 5");
dotnet (1)
Parser.cs (1)
252public static ParseResult Parse(string commandLineUnsplit) => RootCommand.Parse(commandLineUnsplit, ParserConfiguration);
Microsoft.TemplateEngine.Cli (1)
Commands\create\InstantiateCommand.TabCompletion.cs (1)
67ParseResult parseResult = parser.Parse(context.CommandLineText, ParserFactory.ParserConfiguration);
System.CommandLine (1)
Completions\CompletionAction.cs (1)
29var completionParseResult = parseResult.RootCommandResult.Command.Parse(commandLineToComplete, parseResult.Configuration);