Skip to content
Merged
8 changes: 1 addition & 7 deletions src/Aspire.Cli/Commands/AddCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ public AddCommand(IDotNetCliRunner runner, INuGetPackageCache nuGetPackageCache,
versionOption.Description = "The version of the integration to add.";
Options.Add(versionOption);

var prereleaseOption = new Option<bool>("--prerelease");
prereleaseOption.Description = "Include pre-release versions of the integration when searching.";
Options.Add(prereleaseOption);

var sourceOption = new Option<string?>("--source", "-s");
sourceOption.Description = "The NuGet source to use for the integration.";
Options.Add(sourceOption);
Expand All @@ -79,13 +75,11 @@ protected override async Task<int> ExecuteAsync(ParseResult parseResult, Cancell
return ExitCodeConstants.FailedToFindProject;
}

var prerelease = parseResult.GetValue<bool>("--prerelease");

var source = parseResult.GetValue<string?>("--source");

var packages = await _interactionService.ShowStatusAsync(
"Searching for Aspire packages...",
() => _nuGetPackageCache.GetIntegrationPackagesAsync(effectiveAppHostProjectFile.Directory!, prerelease, source, cancellationToken)
() => _nuGetPackageCache.GetIntegrationPackagesAsync(effectiveAppHostProjectFile.Directory!, true, source, cancellationToken)
Comment thread
davidfowl marked this conversation as resolved.
Outdated
);

var version = parseResult.GetValue<string?>("--version");
Expand Down
7 changes: 1 addition & 6 deletions src/Aspire.Cli/Commands/NewCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ public NewCommand(IDotNetCliRunner runner, INuGetPackageCache nuGetPackageCache,
var templateVersionOption = new Option<string?>("--version", "-v");
templateVersionOption.Description = "The version of the project templates to use.";
Options.Add(templateVersionOption);

var prereleaseOption = new Option<bool>("--prerelease");
prereleaseOption.Description = "Include prerelease versions when searching for project templates.";
Options.Add(prereleaseOption);
}

private async Task<(string TemplateName, string TemplateDescription, Func<string, string> PathDeriver)> GetProjectTemplateAsync(ParseResult parseResult, CancellationToken cancellationToken)
Expand Down Expand Up @@ -141,9 +137,8 @@ protected override async Task<int> ExecuteAsync(ParseResult parseResult, Cancell
var template = await GetProjectTemplateAsync(parseResult, cancellationToken);
var name = await GetProjectNameAsync(parseResult, cancellationToken);
var outputPath = await GetOutputPathAsync(parseResult, template.PathDeriver, name, cancellationToken);
var prerelease = parseResult.GetValue<bool>("--prerelease");
var source = parseResult.GetValue<string?>("--source");
var version = await GetProjectTemplatesVersionAsync(parseResult, prerelease, source, cancellationToken);
var version = await GetProjectTemplatesVersionAsync(parseResult, true, source, cancellationToken);
Comment thread
mitchdenny marked this conversation as resolved.
Outdated

var templateInstallCollector = new OutputCollector();
var templateInstallResult = await _interactionService.ShowStatusAsync<(int ExitCode, string? TemplateVersion)>(
Expand Down
1 change: 0 additions & 1 deletion src/Aspire.Cli/DotNetCliRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,6 @@ public async Task<int> AddPackageAsync(FileInfo projectFilePath, string packageN
public async Task<(int ExitCode, NuGetPackage[]? Packages)> SearchPackagesAsync(DirectoryInfo workingDirectory, string query, bool prerelease, int take, int skip, string? nugetSource, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
{
using var activity = _activitySource.StartActivity();

List<string> cliArgs = [
"package",
"search",
Expand Down