diff --git a/extension/src/views/AspireAppHostTreeProvider.ts b/extension/src/views/AspireAppHostTreeProvider.ts index 5178b99e7bc..5c6c10af933 100644 --- a/extension/src/views/AspireAppHostTreeProvider.ts +++ b/extension/src/views/AspireAppHostTreeProvider.ts @@ -314,7 +314,7 @@ export class AspireAppHostTreeProvider implements vscode.TreeDataProvider 0 ? ` ${extraArgs.join(' ')}` : ''; - this._terminalProvider.sendAspireCommandToAspireTerminal(`${command} "${element.resource.name}" --apphost "${appHost.appHostPath}"${suffix}`); + this._terminalProvider.sendAspireCommandToAspireTerminal(`resource "${element.resource.name}" ${command} --apphost "${appHost.appHostPath}"${suffix}`); } private _findAppHostForResource(element: ResourceItem): AppHostDisplayInfo | undefined { diff --git a/src/Aspire.Cli/Commands/ResourceCommand.cs b/src/Aspire.Cli/Commands/ResourceCommand.cs index 248951a7877..0bb3721671c 100644 --- a/src/Aspire.Cli/Commands/ResourceCommand.cs +++ b/src/Aspire.Cli/Commands/ResourceCommand.cs @@ -9,6 +9,7 @@ using Aspire.Cli.Resources; using Aspire.Cli.Telemetry; using Aspire.Cli.Utils; +using Aspire.Hosting.ApplicationModel; using Microsoft.Extensions.Logging; namespace Aspire.Cli.Commands; @@ -33,6 +34,16 @@ internal sealed class ResourceCommand : BaseCommand private static readonly OptionWithLegacy s_appHostOption = new("--apphost", "--project", SharedCommandStrings.AppHostOptionDescription); + /// + /// Maps friendly command names to their backchannel equivalents with display metadata. + /// + private static readonly Dictionary s_wellKnownCommands = new(StringComparer.OrdinalIgnoreCase) + { + ["start"] = (KnownResourceCommands.StartCommand, "Starting", "start", "started"), + ["stop"] = (KnownResourceCommands.StopCommand, "Stopping", "stop", "stopped"), + ["restart"] = (KnownResourceCommands.RestartCommand, "Restarting", "restart", "restarted"), + }; + public ResourceCommand( IInteractionService interactionService, IAuxiliaryBackchannelMonitor backchannelMonitor, @@ -41,7 +52,7 @@ public ResourceCommand( CliExecutionContext executionContext, ILogger logger, AspireCliTelemetry telemetry) - : base("command", ResourceCommandStrings.CommandDescription, features, updateNotifier, executionContext, interactionService, telemetry) + : base("resource", ResourceCommandStrings.CommandDescription, features, updateNotifier, executionContext, interactionService, telemetry) { _interactionService = interactionService; _connectionResolver = new AppHostConnectionResolver(backchannelMonitor, interactionService, executionContext, logger); @@ -71,6 +82,21 @@ protected override async Task ExecuteAsync(ParseResult parseResult, Cancell return ExitCodeConstants.FailedToFindProject; } + // Map well-known friendly names (start/stop/restart) to their backchannel equivalents + if (s_wellKnownCommands.TryGetValue(commandName, out var knownCommand)) + { + return await ResourceCommandHelper.ExecuteResourceCommandAsync( + result.Connection!, + _interactionService, + _logger, + resourceName, + knownCommand.BackchannelCommand, + knownCommand.ProgressVerb, + knownCommand.BaseVerb, + knownCommand.PastTenseVerb, + cancellationToken); + } + return await ResourceCommandHelper.ExecuteGenericCommandAsync( result.Connection!, _interactionService, diff --git a/src/Aspire.Cli/Commands/ResourceCommandBase.cs b/src/Aspire.Cli/Commands/ResourceCommandBase.cs deleted file mode 100644 index 3a0484c2bc3..00000000000 --- a/src/Aspire.Cli/Commands/ResourceCommandBase.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.CommandLine; -using System.Globalization; -using Aspire.Cli.Backchannel; -using Aspire.Cli.Configuration; -using Aspire.Cli.Interaction; -using Aspire.Cli.Resources; -using Aspire.Cli.Telemetry; -using Aspire.Cli.Utils; -using Microsoft.Extensions.Logging; - -namespace Aspire.Cli.Commands; - -/// -/// Base class for commands that execute resource lifecycle operations (start, restart, etc.). -/// -internal abstract class ResourceCommandBase : BaseCommand -{ - protected readonly AppHostConnectionResolver ConnectionResolver; - protected readonly ILogger Logger; - - private readonly Argument _resourceArgument; - - protected static readonly OptionWithLegacy s_appHostOption = new("--apphost", "--project", SharedCommandStrings.AppHostOptionDescription); - - /// - /// The resource command name to execute (e.g., KnownResourceCommands.StartCommand). - /// - protected abstract string CommandName { get; } - - /// - /// The verb to display during progress (e.g., "Starting"). - /// - protected abstract string ProgressVerb { get; } - - /// - /// The base verb for error messages (e.g., "start"). - /// - protected abstract string BaseVerb { get; } - - /// - /// The past tense verb for success messages (e.g., "started"). - /// - protected abstract string PastTenseVerb { get; } - - /// - /// The description for the resource argument. - /// - protected abstract string ResourceArgumentDescription { get; } - - protected ResourceCommandBase( - string name, - string description, - IInteractionService interactionService, - IAuxiliaryBackchannelMonitor backchannelMonitor, - IFeatures features, - ICliUpdateNotifier updateNotifier, - CliExecutionContext executionContext, - ILogger logger, - AspireCliTelemetry telemetry) - : base(name, description, features, updateNotifier, executionContext, interactionService, telemetry) - { - ConnectionResolver = new AppHostConnectionResolver(backchannelMonitor, interactionService, executionContext, logger); - Logger = logger; - - _resourceArgument = new Argument("resource") - { - Description = ResourceArgumentDescription - }; - - Arguments.Add(_resourceArgument); - Options.Add(s_appHostOption); - } - - protected override async Task ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken) - { - var resourceName = parseResult.GetValue(_resourceArgument)!; - var passedAppHostProjectFile = parseResult.GetValue(s_appHostOption); - - var result = await ConnectionResolver.ResolveConnectionAsync( - passedAppHostProjectFile, - SharedCommandStrings.ScanningForRunningAppHosts, - string.Format(CultureInfo.CurrentCulture, SharedCommandStrings.SelectAppHost, ResourceCommandStrings.SelectAppHostAction), - SharedCommandStrings.AppHostNotRunning, - cancellationToken); - - if (!result.Success) - { - InteractionService.DisplayError(result.ErrorMessage); - return ExitCodeConstants.FailedToFindProject; - } - - return await ResourceCommandHelper.ExecuteResourceCommandAsync( - result.Connection!, - InteractionService, - Logger, - resourceName, - CommandName, - ProgressVerb, - BaseVerb, - PastTenseVerb, - cancellationToken); - } -} diff --git a/src/Aspire.Cli/Commands/RestartCommand.cs b/src/Aspire.Cli/Commands/RestartCommand.cs deleted file mode 100644 index 9979d25241e..00000000000 --- a/src/Aspire.Cli/Commands/RestartCommand.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Aspire.Cli.Backchannel; -using Aspire.Cli.Configuration; -using Aspire.Cli.Interaction; -using Aspire.Cli.Resources; -using Aspire.Cli.Telemetry; -using Aspire.Cli.Utils; -using Aspire.Hosting.ApplicationModel; -using Microsoft.Extensions.Logging; - -namespace Aspire.Cli.Commands; - -internal sealed class RestartCommand : ResourceCommandBase -{ - internal override HelpGroup HelpGroup => HelpGroup.ResourceManagement; - - protected override string CommandName => KnownResourceCommands.RestartCommand; - protected override string ProgressVerb => "Restarting"; - protected override string BaseVerb => "restart"; - protected override string PastTenseVerb => "restarted"; - protected override string ResourceArgumentDescription => ResourceCommandStrings.RestartResourceArgumentDescription; - - public RestartCommand( - IInteractionService interactionService, - IAuxiliaryBackchannelMonitor backchannelMonitor, - IFeatures features, - ICliUpdateNotifier updateNotifier, - CliExecutionContext executionContext, - ILogger logger, - AspireCliTelemetry telemetry) - : base("restart", ResourceCommandStrings.RestartDescription, - interactionService, backchannelMonitor, features, updateNotifier, - executionContext, logger, telemetry) - { - } -} diff --git a/src/Aspire.Cli/Commands/RootCommand.cs b/src/Aspire.Cli/Commands/RootCommand.cs index 1b1148075fc..43fe3bfb7b6 100644 --- a/src/Aspire.Cli/Commands/RootCommand.cs +++ b/src/Aspire.Cli/Commands/RootCommand.cs @@ -112,7 +112,6 @@ public RootCommand( RunCommand runCommand, StopCommand stopCommand, StartCommand startCommand, - RestartCommand restartCommand, WaitCommand waitCommand, ResourceCommand commandCommand, PsCommand psCommand, @@ -200,7 +199,6 @@ public RootCommand( Subcommands.Add(runCommand); Subcommands.Add(stopCommand); Subcommands.Add(startCommand); - Subcommands.Add(restartCommand); Subcommands.Add(waitCommand); Subcommands.Add(commandCommand); Subcommands.Add(psCommand); diff --git a/src/Aspire.Cli/Commands/StartCommand.cs b/src/Aspire.Cli/Commands/StartCommand.cs index 19e82971690..8fc1be7d9f8 100644 --- a/src/Aspire.Cli/Commands/StartCommand.cs +++ b/src/Aspire.Cli/Commands/StartCommand.cs @@ -2,32 +2,20 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.CommandLine; -using System.Globalization; -using Aspire.Cli.Backchannel; using Aspire.Cli.Configuration; using Aspire.Cli.Interaction; using Aspire.Cli.Resources; using Aspire.Cli.Telemetry; using Aspire.Cli.Utils; -using Aspire.Hosting.ApplicationModel; -using Microsoft.Extensions.Logging; namespace Aspire.Cli.Commands; internal sealed class StartCommand : BaseCommand { - internal override HelpGroup HelpGroup => HelpGroup.ResourceManagement; + internal override HelpGroup HelpGroup => HelpGroup.AppCommands; - private readonly IInteractionService _interactionService; - private readonly AppHostConnectionResolver _connectionResolver; private readonly AppHostLauncher _appHostLauncher; - private readonly ILogger _logger; - - private static readonly Argument s_resourceArgument = new("resource") - { - Description = ResourceCommandStrings.StartResourceArgumentDescription, - Arity = ArgumentArity.ZeroOrOne - }; + private readonly IInteractionService _interactionService; private static readonly Option s_noBuildOption = new("--no-build") { @@ -36,22 +24,17 @@ internal sealed class StartCommand : BaseCommand public StartCommand( IInteractionService interactionService, - IAuxiliaryBackchannelMonitor backchannelMonitor, IFeatures features, ICliUpdateNotifier updateNotifier, CliExecutionContext executionContext, - ILogger logger, AspireCliTelemetry telemetry, AppHostLauncher appHostLauncher) - : base("start", ResourceCommandStrings.StartDescription, + : base("start", StartCommandStrings.Description, features, updateNotifier, executionContext, interactionService, telemetry) { _interactionService = interactionService; - _connectionResolver = new AppHostConnectionResolver(backchannelMonitor, interactionService, executionContext, logger); _appHostLauncher = appHostLauncher; - _logger = logger; - Arguments.Add(s_resourceArgument); Options.Add(s_noBuildOption); AppHostLauncher.AddLaunchOptions(this); @@ -60,30 +43,10 @@ public StartCommand( protected override async Task ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken) { - var resourceName = parseResult.GetValue(s_resourceArgument); var passedAppHostProjectFile = parseResult.GetValue(AppHostLauncher.s_appHostOption); var format = parseResult.GetValue(AppHostLauncher.s_formatOption); var isolated = parseResult.GetValue(AppHostLauncher.s_isolatedOption); - // If a resource name is provided, start that specific resource - if (!string.IsNullOrEmpty(resourceName)) - { - if (format == OutputFormat.Json) - { - _interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ResourceCommandStrings.OptionNotValidWithResource, "--format")); - return ExitCodeConstants.InvalidCommand; - } - - if (isolated) - { - _interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ResourceCommandStrings.OptionNotValidWithResource, "--isolated")); - return ExitCodeConstants.InvalidCommand; - } - - return await StartResourceAsync(passedAppHostProjectFile, resourceName, cancellationToken); - } - - // No resource specified — start the AppHost in detached mode var noBuild = parseResult.GetValue(s_noBuildOption); var isExtensionHost = ExtensionHelper.IsExtensionHost(_interactionService, out _, out _); var globalArgs = RootCommand.GetChildProcessArgs(parseResult); @@ -103,31 +66,4 @@ protected override async Task ExecuteAsync(ParseResult parseResult, Cancell additionalArgs, cancellationToken); } - - private async Task StartResourceAsync(FileInfo? passedAppHostProjectFile, string resourceName, CancellationToken cancellationToken) - { - var result = await _connectionResolver.ResolveConnectionAsync( - passedAppHostProjectFile, - SharedCommandStrings.ScanningForRunningAppHosts, - string.Format(CultureInfo.CurrentCulture, SharedCommandStrings.SelectAppHost, ResourceCommandStrings.SelectAppHostAction), - SharedCommandStrings.AppHostNotRunning, - cancellationToken); - - if (!result.Success) - { - _interactionService.DisplayError(result.ErrorMessage); - return ExitCodeConstants.FailedToFindProject; - } - - return await ResourceCommandHelper.ExecuteResourceCommandAsync( - result.Connection!, - _interactionService, - _logger, - resourceName, - KnownResourceCommands.StartCommand, - "Starting", - "start", - "started", - cancellationToken); - } } diff --git a/src/Aspire.Cli/Commands/StopCommand.cs b/src/Aspire.Cli/Commands/StopCommand.cs index 2123fb3eea5..9969d0c22a2 100644 --- a/src/Aspire.Cli/Commands/StopCommand.cs +++ b/src/Aspire.Cli/Commands/StopCommand.cs @@ -11,7 +11,6 @@ using Aspire.Cli.Resources; using Aspire.Cli.Telemetry; using Aspire.Cli.Utils; -using Aspire.Hosting.ApplicationModel; using Microsoft.Extensions.Logging; namespace Aspire.Cli.Commands; @@ -26,12 +25,6 @@ internal sealed class StopCommand : BaseCommand private readonly ICliHostEnvironment _hostEnvironment; private readonly TimeProvider _timeProvider; - private static readonly Argument s_resourceArgument = new("resource") - { - Description = "The name of the resource to stop. If not specified, stops the entire AppHost.", - Arity = ArgumentArity.ZeroOrOne - }; - private static readonly OptionWithLegacy s_appHostOption = new("--apphost", "--project", StopCommandStrings.ProjectArgumentDescription); private static readonly Option s_allOption = new("--all") @@ -57,14 +50,12 @@ public StopCommand( _logger = logger; _timeProvider = timeProvider ?? TimeProvider.System; - Arguments.Add(s_resourceArgument); Options.Add(s_appHostOption); Options.Add(s_allOption); } protected override async Task ExecuteAsync(ParseResult parseResult, CancellationToken cancellationToken) { - var resourceName = parseResult.GetValue(s_resourceArgument); var passedAppHostProjectFile = parseResult.GetValue(s_appHostOption); var stopAll = parseResult.GetValue(s_allOption); @@ -75,13 +66,6 @@ protected override async Task ExecuteAsync(ParseResult parseResult, Cancell return ExitCodeConstants.FailedToFindProject; } - // Validate mutual exclusivity of --all and resource argument - if (stopAll && !string.IsNullOrEmpty(resourceName)) - { - _interactionService.DisplayError(string.Format(CultureInfo.InvariantCulture, StopCommandStrings.AllAndResourceMutuallyExclusive, s_allOption.Name)); - return ExitCodeConstants.FailedToFindProject; - } - // Handle --all: stop all running AppHosts if (stopAll) { @@ -91,22 +75,22 @@ protected override async Task ExecuteAsync(ParseResult parseResult, Cancell // In non-interactive mode, try to auto-resolve without prompting if (!_hostEnvironment.SupportsInteractiveInput) { - return await ExecuteNonInteractiveAsync(passedAppHostProjectFile, resourceName, cancellationToken); + return await ExecuteNonInteractiveAsync(passedAppHostProjectFile, cancellationToken); } - return await ExecuteInteractiveAsync(passedAppHostProjectFile, resourceName, cancellationToken); + return await ExecuteInteractiveAsync(passedAppHostProjectFile, cancellationToken); } /// /// Handles the stop command in non-interactive mode by auto-resolving a single AppHost /// or returning an error when multiple AppHosts are running. /// - private async Task ExecuteNonInteractiveAsync(FileInfo? passedAppHostProjectFile, string? resourceName, CancellationToken cancellationToken) + private async Task ExecuteNonInteractiveAsync(FileInfo? passedAppHostProjectFile, CancellationToken cancellationToken) { // If --project is specified, use the standard resolver (no prompting needed) if (passedAppHostProjectFile is not null) { - return await ExecuteInteractiveAsync(passedAppHostProjectFile, resourceName, cancellationToken); + return await ExecuteInteractiveAsync(passedAppHostProjectFile, cancellationToken); } // Scan for all running AppHosts @@ -128,10 +112,6 @@ private async Task ExecuteNonInteractiveAsync(FileInfo? passedAppHostProjec if (inScopeConnections.Length == 1) { var connection = inScopeConnections[0].Connection!; - if (!string.IsNullOrEmpty(resourceName)) - { - return await StopResourceAsync(connection, resourceName, cancellationToken); - } return await StopAppHostAsync(connection, cancellationToken); } @@ -143,7 +123,7 @@ private async Task ExecuteNonInteractiveAsync(FileInfo? passedAppHostProjec /// /// Handles the stop command in interactive mode, prompting the user to select an AppHost if multiple are running. /// - private async Task ExecuteInteractiveAsync(FileInfo? passedAppHostProjectFile, string? resourceName, CancellationToken cancellationToken) + private async Task ExecuteInteractiveAsync(FileInfo? passedAppHostProjectFile, CancellationToken cancellationToken) { var result = await _connectionResolver.ResolveConnectionAsync( passedAppHostProjectFile, @@ -158,14 +138,7 @@ private async Task ExecuteInteractiveAsync(FileInfo? passedAppHostProjectFi return ExitCodeConstants.Success; } - var selectedConnection = result.Connection!; - - if (!string.IsNullOrEmpty(resourceName)) - { - return await StopResourceAsync(selectedConnection, resourceName, cancellationToken); - } - - return await StopAppHostAsync(selectedConnection, cancellationToken); + return await StopAppHostAsync(result.Connection!, cancellationToken); } /// @@ -337,20 +310,4 @@ private static void SendStopSignal(int pid) } } - /// - /// Stops a specific resource instead of the entire AppHost. - /// - private Task StopResourceAsync(IAppHostAuxiliaryBackchannel connection, string resourceName, CancellationToken cancellationToken) - { - return ResourceCommandHelper.ExecuteResourceCommandAsync( - connection, - _interactionService, - _logger, - resourceName, - KnownResourceCommands.StopCommand, - "Stopping", - "stop", - "stopped", - cancellationToken); - } } diff --git a/src/Aspire.Cli/Program.cs b/src/Aspire.Cli/Program.cs index 1a52021b572..14720b4450f 100644 --- a/src/Aspire.Cli/Program.cs +++ b/src/Aspire.Cli/Program.cs @@ -371,7 +371,6 @@ internal static async Task BuildApplicationAsync(string[] args, Dictionar builder.Services.AddTransient(); builder.Services.AddTransient(); builder.Services.AddTransient(); - builder.Services.AddTransient(); builder.Services.AddTransient(); builder.Services.AddTransient(); builder.Services.AddTransient(); diff --git a/src/Aspire.Cli/Resources/ResourceCommandStrings.Designer.cs b/src/Aspire.Cli/Resources/ResourceCommandStrings.Designer.cs index cf4c27677f3..a8b53222983 100644 --- a/src/Aspire.Cli/Resources/ResourceCommandStrings.Designer.cs +++ b/src/Aspire.Cli/Resources/ResourceCommandStrings.Designer.cs @@ -51,30 +51,6 @@ internal static string SelectAppHostAction { } } - internal static string StartDescription { - get { - return ResourceManager.GetString("StartDescription", resourceCulture); - } - } - - internal static string StartResourceArgumentDescription { - get { - return ResourceManager.GetString("StartResourceArgumentDescription", resourceCulture); - } - } - - internal static string RestartDescription { - get { - return ResourceManager.GetString("RestartDescription", resourceCulture); - } - } - - internal static string RestartResourceArgumentDescription { - get { - return ResourceManager.GetString("RestartResourceArgumentDescription", resourceCulture); - } - } - internal static string CommandDescription { get { return ResourceManager.GetString("CommandDescription", resourceCulture); @@ -93,10 +69,5 @@ internal static string CommandNameArgumentDescription { } } - internal static string OptionNotValidWithResource { - get { - return ResourceManager.GetString("OptionNotValidWithResource", resourceCulture); - } - } } } diff --git a/src/Aspire.Cli/Resources/ResourceCommandStrings.resx b/src/Aspire.Cli/Resources/ResourceCommandStrings.resx index 12004c39c05..cc889718167 100644 --- a/src/Aspire.Cli/Resources/ResourceCommandStrings.resx +++ b/src/Aspire.Cli/Resources/ResourceCommandStrings.resx @@ -61,28 +61,13 @@ connect to - - Start an apphost in the background, or start a stopped resource. - - - The name of the resource to start. If not specified, starts the AppHost in the background. - - - Restart a running resource. - - - The name of the resource to restart. - - Execute a command on a resource. + Execute a command on a resource (e.g. start, stop, restart). The name of the resource to execute the command on. - The name of the command to execute. - - - The '{0}' option is not valid when starting a resource. + The name of the command to execute (e.g. start, stop, restart). diff --git a/src/Aspire.Cli/Resources/StartCommandStrings.Designer.cs b/src/Aspire.Cli/Resources/StartCommandStrings.Designer.cs new file mode 100644 index 00000000000..3c9d761e05f --- /dev/null +++ b/src/Aspire.Cli/Resources/StartCommandStrings.Designer.cs @@ -0,0 +1,55 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Aspire.Cli.Resources { + using System; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class StartCommandStrings { + + private static System.Resources.ResourceManager resourceMan; + + private static System.Globalization.CultureInfo resourceCulture; + + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal StartCommandStrings() { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Resources.ResourceManager ResourceManager { + get { + if (object.Equals(null, resourceMan)) { + System.Resources.ResourceManager temp = new System.Resources.ResourceManager("Aspire.Cli.Resources.StartCommandStrings", typeof(StartCommandStrings).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static string Description { + get { + return ResourceManager.GetString("Description", resourceCulture); + } + } + + } +} diff --git a/src/Aspire.Cli/Resources/StartCommandStrings.resx b/src/Aspire.Cli/Resources/StartCommandStrings.resx new file mode 100644 index 00000000000..adc1fd53064 --- /dev/null +++ b/src/Aspire.Cli/Resources/StartCommandStrings.resx @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Start an apphost in the background. + + diff --git a/src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs b/src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs index c4e6da1a2d1..453094bd7bf 100644 --- a/src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs +++ b/src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs @@ -105,10 +105,5 @@ public static string AllAndProjectMutuallyExclusive { } } - public static string AllAndResourceMutuallyExclusive { - get { - return ResourceManager.GetString("AllAndResourceMutuallyExclusive", resourceCulture); - } - } } } diff --git a/src/Aspire.Cli/Resources/StopCommandStrings.resx b/src/Aspire.Cli/Resources/StopCommandStrings.resx index 77ab8659ac2..ac2fed6a225 100644 --- a/src/Aspire.Cli/Resources/StopCommandStrings.resx +++ b/src/Aspire.Cli/Resources/StopCommandStrings.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Stop a running apphost or the specified resource. + Stop a running apphost. The path to the Aspire AppHost project file. @@ -147,7 +147,4 @@ The {0} and {1} options cannot be used together. - - The {0} option cannot be used with a resource argument. - diff --git a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.cs.xlf b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.cs.xlf index 73bdcd553dc..a33d68d0fc9 100644 --- a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.cs.xlf +++ b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.cs.xlf @@ -3,12 +3,12 @@ - Execute a command on a resource. + Execute a command on a resource (e.g. start, stop, restart). Spusťte příkaz pro prostředek. - The name of the command to execute. + The name of the command to execute (e.g. start, stop, restart). Název příkazu, který se má spustit @@ -17,36 +17,11 @@ Název prostředku, na kterém se má příkaz provést - - The '{0}' option is not valid when starting a resource. - The '{0}' option is not valid when starting a resource. - - - - Restart a running resource. - Restartujte spuštěný prostředek. - - - - The name of the resource to restart. - Název prostředku, který se má restartovat - - connect to connect to - - Start an apphost in the background, or start a stopped resource. - Spusťte zastavený prostředek. - - - - The name of the resource to start. If not specified, starts the AppHost in the background. - Název prostředku, který se má spustit - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.de.xlf b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.de.xlf index d3c7fba709b..f45a6f53b27 100644 --- a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.de.xlf +++ b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.de.xlf @@ -3,12 +3,12 @@ - Execute a command on a resource. + Execute a command on a resource (e.g. start, stop, restart). Führen Sie einen Befehl auf einer Ressource aus. - The name of the command to execute. + The name of the command to execute (e.g. start, stop, restart). Der Name des auszuführenden Befehls. @@ -17,36 +17,11 @@ Der Name der Ressource, für die der Befehl ausgeführt werden soll. - - The '{0}' option is not valid when starting a resource. - The '{0}' option is not valid when starting a resource. - - - - Restart a running resource. - Starten Sie eine laufende Ressource neu. - - - - The name of the resource to restart. - Der Name der Ressource, die neu gestartet werden soll. - - connect to connect to - - Start an apphost in the background, or start a stopped resource. - Starten Sie eine gestoppte Ressource. - - - - The name of the resource to start. If not specified, starts the AppHost in the background. - Der Name der Ressource, die gestartet werden soll. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.es.xlf b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.es.xlf index 1b2e4fe4b0c..9dbb8134797 100644 --- a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.es.xlf +++ b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.es.xlf @@ -3,12 +3,12 @@ - Execute a command on a resource. + Execute a command on a resource (e.g. start, stop, restart). Ejecute un comando en un recurso. - The name of the command to execute. + The name of the command to execute (e.g. start, stop, restart). Nombre del comando que se va a ejecutar. @@ -17,36 +17,11 @@ El nombre del recurso de destino en el que se ejecutará el comando. - - The '{0}' option is not valid when starting a resource. - The '{0}' option is not valid when starting a resource. - - - - Restart a running resource. - Reinicie un recurso en ejecución. - - - - The name of the resource to restart. - Nombre del recurso que se va a reiniciar. - - connect to connect to - - Start an apphost in the background, or start a stopped resource. - Inicie un recurso detenido. - - - - The name of the resource to start. If not specified, starts the AppHost in the background. - Nombre del recurso que se va a iniciar. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.fr.xlf b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.fr.xlf index 70b7be80431..24a6d646115 100644 --- a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.fr.xlf +++ b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.fr.xlf @@ -3,12 +3,12 @@ - Execute a command on a resource. + Execute a command on a resource (e.g. start, stop, restart). Exécuter une commande sur une ressource. - The name of the command to execute. + The name of the command to execute (e.g. start, stop, restart). Le nom de la commande à exécuter. @@ -17,36 +17,11 @@ Nom de la ressource sur laquelle exécuter la commande. - - The '{0}' option is not valid when starting a resource. - The '{0}' option is not valid when starting a resource. - - - - Restart a running resource. - Redémarrer une ressource en cours d’exécution. - - - - The name of the resource to restart. - Le nom de la ressource à redémarrer. - - connect to connect to - - Start an apphost in the background, or start a stopped resource. - Démarrer une ressource arrêtée. - - - - The name of the resource to start. If not specified, starts the AppHost in the background. - Le nom de la ressource à commencer. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.it.xlf b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.it.xlf index d69449f3e5e..607d2b38095 100644 --- a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.it.xlf +++ b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.it.xlf @@ -3,12 +3,12 @@ - Execute a command on a resource. + Execute a command on a resource (e.g. start, stop, restart). Eseguire un comando su una risorsa. - The name of the command to execute. + The name of the command to execute (e.g. start, stop, restart). Nome del comando da eseguire. @@ -17,36 +17,11 @@ Nome della risorsa di destinazione rispetto al quale eseguire il comando. - - The '{0}' option is not valid when starting a resource. - The '{0}' option is not valid when starting a resource. - - - - Restart a running resource. - Riavviare una risorsa in esecuzione. - - - - The name of the resource to restart. - Nome della risorsa da riavviare. - - connect to connect to - - Start an apphost in the background, or start a stopped resource. - Avviare una risorsa arrestata. - - - - The name of the resource to start. If not specified, starts the AppHost in the background. - Nome della risorsa da avviare. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.ja.xlf b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.ja.xlf index cb5b024e9c7..1911bb6937f 100644 --- a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.ja.xlf +++ b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.ja.xlf @@ -3,12 +3,12 @@ - Execute a command on a resource. + Execute a command on a resource (e.g. start, stop, restart). リソースでコマンドを実行します。 - The name of the command to execute. + The name of the command to execute (e.g. start, stop, restart). 実行するコマンドの名前。 @@ -17,36 +17,11 @@ コマンドを実行する対象のリソースの名前。 - - The '{0}' option is not valid when starting a resource. - The '{0}' option is not valid when starting a resource. - - - - Restart a running resource. - 実行中のリソースを再起動します。 - - - - The name of the resource to restart. - 再起動するリソースの名前。 - - connect to connect to - - Start an apphost in the background, or start a stopped resource. - 停止しているリソースを開始します。 - - - - The name of the resource to start. If not specified, starts the AppHost in the background. - 開始するリソースの名前。 - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.ko.xlf b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.ko.xlf index ffd945c2525..af92d629efd 100644 --- a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.ko.xlf +++ b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.ko.xlf @@ -3,12 +3,12 @@ - Execute a command on a resource. + Execute a command on a resource (e.g. start, stop, restart). 리소스에서 명령을 실행합니다. - The name of the command to execute. + The name of the command to execute (e.g. start, stop, restart). 실행할 명령의 이름입니다. @@ -17,36 +17,11 @@ 명령을 실행할 대상 리소스의 이름입니다. - - The '{0}' option is not valid when starting a resource. - The '{0}' option is not valid when starting a resource. - - - - Restart a running resource. - 실행 중인 리소스를 다시 시작합니다. - - - - The name of the resource to restart. - 다시 시작할 리소스의 이름입니다. - - connect to connect to - - Start an apphost in the background, or start a stopped resource. - 중지된 리소스를 시작합니다. - - - - The name of the resource to start. If not specified, starts the AppHost in the background. - 시작할 리소스의 이름입니다. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.pl.xlf b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.pl.xlf index 7661fc8b71b..1e3f31ad1a4 100644 --- a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.pl.xlf +++ b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.pl.xlf @@ -3,12 +3,12 @@ - Execute a command on a resource. + Execute a command on a resource (e.g. start, stop, restart). Wykonaj polecenie dla zasobu. - The name of the command to execute. + The name of the command to execute (e.g. start, stop, restart). Nazwa polecenia do wykonania. @@ -17,36 +17,11 @@ Nazwa zasobu, na którym ma zostać wykonane polecenie. - - The '{0}' option is not valid when starting a resource. - The '{0}' option is not valid when starting a resource. - - - - Restart a running resource. - Uruchom ponownie uruchomiony zasób. - - - - The name of the resource to restart. - Nazwa zasobu do ponownego uruchomienia. - - connect to connect to - - Start an apphost in the background, or start a stopped resource. - Uruchom zatrzymany zasób. - - - - The name of the resource to start. If not specified, starts the AppHost in the background. - Nazwa zasobu do uruchomienia. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.pt-BR.xlf b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.pt-BR.xlf index 626d0e685d3..07914dd8374 100644 --- a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.pt-BR.xlf +++ b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.pt-BR.xlf @@ -3,12 +3,12 @@ - Execute a command on a resource. + Execute a command on a resource (e.g. start, stop, restart). Execute um comando em um recurso. - The name of the command to execute. + The name of the command to execute (e.g. start, stop, restart). O nome do comando a ser executado. @@ -17,36 +17,11 @@ O nome do recurso no qual executar o comando. - - The '{0}' option is not valid when starting a resource. - The '{0}' option is not valid when starting a resource. - - - - Restart a running resource. - Reinicie um recurso em execução. - - - - The name of the resource to restart. - O nome do recurso a ser reiniciado. - - connect to connect to - - Start an apphost in the background, or start a stopped resource. - Inicie um recurso parado. - - - - The name of the resource to start. If not specified, starts the AppHost in the background. - O nome do recurso a ser iniciado. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.ru.xlf b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.ru.xlf index d909cd81c47..a99fdf50ddb 100644 --- a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.ru.xlf +++ b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.ru.xlf @@ -3,12 +3,12 @@ - Execute a command on a resource. + Execute a command on a resource (e.g. start, stop, restart). Выполнить команду на ресурсе. - The name of the command to execute. + The name of the command to execute (e.g. start, stop, restart). Имя команды, которую нужно выполнить. @@ -17,36 +17,11 @@ Имя целевого ресурса, на котором будет выполняться команда. - - The '{0}' option is not valid when starting a resource. - The '{0}' option is not valid when starting a resource. - - - - Restart a running resource. - Перезапустить уже запущенный ресурс. - - - - The name of the resource to restart. - Имя ресурса, который нужно перезапустить. - - connect to connect to - - Start an apphost in the background, or start a stopped resource. - Запустить остановленный ресурс. - - - - The name of the resource to start. If not specified, starts the AppHost in the background. - Имя ресурса, который нужно запустить. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.tr.xlf b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.tr.xlf index 0c268825148..16f5c3f7898 100644 --- a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.tr.xlf +++ b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.tr.xlf @@ -3,12 +3,12 @@ - Execute a command on a resource. + Execute a command on a resource (e.g. start, stop, restart). Bir kaynak üzerinde bir komut çalıştırın. - The name of the command to execute. + The name of the command to execute (e.g. start, stop, restart). Yürütülecek komutun adı. @@ -17,36 +17,11 @@ Komutu yürütecek kaynağın adı. - - The '{0}' option is not valid when starting a resource. - The '{0}' option is not valid when starting a resource. - - - - Restart a running resource. - Çalışan bir kaynağı yeniden başlatın. - - - - The name of the resource to restart. - Yeniden başlatılacak kaynağın adı. - - connect to connect to - - Start an apphost in the background, or start a stopped resource. - Durdurulmuş bir kaynağı başlatın. - - - - The name of the resource to start. If not specified, starts the AppHost in the background. - Başlatılacak kaynağın adı. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.zh-Hans.xlf b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.zh-Hans.xlf index ddc589c2e40..c70a3525732 100644 --- a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.zh-Hans.xlf +++ b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.zh-Hans.xlf @@ -3,12 +3,12 @@ - Execute a command on a resource. + Execute a command on a resource (e.g. start, stop, restart). 在资源上执行命令。 - The name of the command to execute. + The name of the command to execute (e.g. start, stop, restart). 要执行的命令的名称。 @@ -17,36 +17,11 @@ 要在其上执行命令的资源的名称。 - - The '{0}' option is not valid when starting a resource. - The '{0}' option is not valid when starting a resource. - - - - Restart a running resource. - 重启正在运行的资源。 - - - - The name of the resource to restart. - 要重启的资源的名称。 - - connect to connect to - - Start an apphost in the background, or start a stopped resource. - 启动已停止的资源。 - - - - The name of the resource to start. If not specified, starts the AppHost in the background. - 要启动的资源的名称。 - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.zh-Hant.xlf b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.zh-Hant.xlf index 00fff5633e8..5b7ad66f13e 100644 --- a/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.zh-Hant.xlf +++ b/src/Aspire.Cli/Resources/xlf/ResourceCommandStrings.zh-Hant.xlf @@ -3,12 +3,12 @@ - Execute a command on a resource. + Execute a command on a resource (e.g. start, stop, restart). 在資源上執行命令。 - The name of the command to execute. + The name of the command to execute (e.g. start, stop, restart). 所要執行命令的名稱。 @@ -17,36 +17,11 @@ 要執行命令的資源名稱。 - - The '{0}' option is not valid when starting a resource. - The '{0}' option is not valid when starting a resource. - - - - Restart a running resource. - 重新啟動正在執行的資源。 - - - - The name of the resource to restart. - 要重新啟動的資源名稱。 - - connect to connect to - - Start an apphost in the background, or start a stopped resource. - 啟動已停止的資源。 - - - - The name of the resource to start. If not specified, starts the AppHost in the background. - 要啟動的資源名稱。 - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/StartCommandStrings.cs.xlf b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.cs.xlf new file mode 100644 index 00000000000..147c6bfc7ef --- /dev/null +++ b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.cs.xlf @@ -0,0 +1,12 @@ + + + + + + Start an apphost in the background. + Start an apphost in the background. + + + + + diff --git a/src/Aspire.Cli/Resources/xlf/StartCommandStrings.de.xlf b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.de.xlf new file mode 100644 index 00000000000..17f0a4aac54 --- /dev/null +++ b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.de.xlf @@ -0,0 +1,12 @@ + + + + + + Start an apphost in the background. + Start an apphost in the background. + + + + + diff --git a/src/Aspire.Cli/Resources/xlf/StartCommandStrings.es.xlf b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.es.xlf new file mode 100644 index 00000000000..d6f3c308e84 --- /dev/null +++ b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.es.xlf @@ -0,0 +1,12 @@ + + + + + + Start an apphost in the background. + Start an apphost in the background. + + + + + diff --git a/src/Aspire.Cli/Resources/xlf/StartCommandStrings.fr.xlf b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.fr.xlf new file mode 100644 index 00000000000..4d1ecc2883a --- /dev/null +++ b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.fr.xlf @@ -0,0 +1,12 @@ + + + + + + Start an apphost in the background. + Start an apphost in the background. + + + + + diff --git a/src/Aspire.Cli/Resources/xlf/StartCommandStrings.it.xlf b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.it.xlf new file mode 100644 index 00000000000..8cc171ceeef --- /dev/null +++ b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.it.xlf @@ -0,0 +1,12 @@ + + + + + + Start an apphost in the background. + Start an apphost in the background. + + + + + diff --git a/src/Aspire.Cli/Resources/xlf/StartCommandStrings.ja.xlf b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.ja.xlf new file mode 100644 index 00000000000..248c2d08b17 --- /dev/null +++ b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.ja.xlf @@ -0,0 +1,12 @@ + + + + + + Start an apphost in the background. + Start an apphost in the background. + + + + + diff --git a/src/Aspire.Cli/Resources/xlf/StartCommandStrings.ko.xlf b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.ko.xlf new file mode 100644 index 00000000000..9a1175fd687 --- /dev/null +++ b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.ko.xlf @@ -0,0 +1,12 @@ + + + + + + Start an apphost in the background. + Start an apphost in the background. + + + + + diff --git a/src/Aspire.Cli/Resources/xlf/StartCommandStrings.pl.xlf b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.pl.xlf new file mode 100644 index 00000000000..a919d1ee3df --- /dev/null +++ b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.pl.xlf @@ -0,0 +1,12 @@ + + + + + + Start an apphost in the background. + Start an apphost in the background. + + + + + diff --git a/src/Aspire.Cli/Resources/xlf/StartCommandStrings.pt-BR.xlf b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.pt-BR.xlf new file mode 100644 index 00000000000..e48f0a6ad9a --- /dev/null +++ b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.pt-BR.xlf @@ -0,0 +1,12 @@ + + + + + + Start an apphost in the background. + Start an apphost in the background. + + + + + diff --git a/src/Aspire.Cli/Resources/xlf/StartCommandStrings.ru.xlf b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.ru.xlf new file mode 100644 index 00000000000..4cf60b12a69 --- /dev/null +++ b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.ru.xlf @@ -0,0 +1,12 @@ + + + + + + Start an apphost in the background. + Start an apphost in the background. + + + + + diff --git a/src/Aspire.Cli/Resources/xlf/StartCommandStrings.tr.xlf b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.tr.xlf new file mode 100644 index 00000000000..3c08449a7aa --- /dev/null +++ b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.tr.xlf @@ -0,0 +1,12 @@ + + + + + + Start an apphost in the background. + Start an apphost in the background. + + + + + diff --git a/src/Aspire.Cli/Resources/xlf/StartCommandStrings.zh-Hans.xlf b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.zh-Hans.xlf new file mode 100644 index 00000000000..262dce60017 --- /dev/null +++ b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.zh-Hans.xlf @@ -0,0 +1,12 @@ + + + + + + Start an apphost in the background. + Start an apphost in the background. + + + + + diff --git a/src/Aspire.Cli/Resources/xlf/StartCommandStrings.zh-Hant.xlf b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.zh-Hant.xlf new file mode 100644 index 00000000000..15b5f3aee34 --- /dev/null +++ b/src/Aspire.Cli/Resources/xlf/StartCommandStrings.zh-Hant.xlf @@ -0,0 +1,12 @@ + + + + + + Start an apphost in the background. + Start an apphost in the background. + + + + + diff --git a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.cs.xlf b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.cs.xlf index f80b25b8447..8e5e95cbc0c 100644 --- a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.cs.xlf +++ b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.cs.xlf @@ -1,4 +1,4 @@ - + @@ -13,7 +13,7 @@ - Stop a running apphost or the specified resource. + Stop a running apphost. Zastavte spuštěného hostitele aplikací Aspire. @@ -52,11 +52,6 @@ The {0} and {1} options cannot be used together. - - The {0} option cannot be used with a resource argument. - The {0} option cannot be used with a resource argument. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.de.xlf b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.de.xlf index 6d3e8ab7155..f11c98594e3 100644 --- a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.de.xlf +++ b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.de.xlf @@ -1,4 +1,4 @@ - + @@ -13,7 +13,7 @@ - Stop a running apphost or the specified resource. + Stop a running apphost. Beenden Sie einen aktiven Aspire-AppHost. @@ -52,11 +52,6 @@ The {0} and {1} options cannot be used together. - - The {0} option cannot be used with a resource argument. - The {0} option cannot be used with a resource argument. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.es.xlf b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.es.xlf index 08a7ce618be..ed2560c6a93 100644 --- a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.es.xlf +++ b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.es.xlf @@ -1,4 +1,4 @@ - + @@ -13,7 +13,7 @@ - Stop a running apphost or the specified resource. + Stop a running apphost. Detenga un apphost en ejecución de Aspire. @@ -52,11 +52,6 @@ The {0} and {1} options cannot be used together. - - The {0} option cannot be used with a resource argument. - The {0} option cannot be used with a resource argument. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.fr.xlf b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.fr.xlf index 7784090de21..ce390ab6a5c 100644 --- a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.fr.xlf +++ b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.fr.xlf @@ -1,4 +1,4 @@ - + @@ -13,7 +13,7 @@ - Stop a running apphost or the specified resource. + Stop a running apphost. Arrêtez un AppHost Aspire en cours d’exécution. @@ -52,11 +52,6 @@ The {0} and {1} options cannot be used together. - - The {0} option cannot be used with a resource argument. - The {0} option cannot be used with a resource argument. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.it.xlf b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.it.xlf index 380e151a3be..115944c970f 100644 --- a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.it.xlf +++ b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.it.xlf @@ -1,4 +1,4 @@ - + @@ -13,7 +13,7 @@ - Stop a running apphost or the specified resource. + Stop a running apphost. Arrestare un apphost Aspire in esecuzione. @@ -52,11 +52,6 @@ The {0} and {1} options cannot be used together. - - The {0} option cannot be used with a resource argument. - The {0} option cannot be used with a resource argument. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.ja.xlf b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.ja.xlf index b243b954ba7..b6d1eb996a5 100644 --- a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.ja.xlf +++ b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.ja.xlf @@ -1,4 +1,4 @@ - + @@ -13,7 +13,7 @@ - Stop a running apphost or the specified resource. + Stop a running apphost. 実行中の Aspire apphost を停止します。 @@ -52,11 +52,6 @@ The {0} and {1} options cannot be used together. - - The {0} option cannot be used with a resource argument. - The {0} option cannot be used with a resource argument. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.ko.xlf b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.ko.xlf index fe3fe6184b8..5ee8ba39293 100644 --- a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.ko.xlf +++ b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.ko.xlf @@ -1,4 +1,4 @@ - + @@ -13,7 +13,7 @@ - Stop a running apphost or the specified resource. + Stop a running apphost. 실행 중인 Aspire AppHost를 중지합니다. @@ -52,11 +52,6 @@ The {0} and {1} options cannot be used together. - - The {0} option cannot be used with a resource argument. - The {0} option cannot be used with a resource argument. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.pl.xlf b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.pl.xlf index bd1c07ed25c..d3528963b4b 100644 --- a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.pl.xlf +++ b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.pl.xlf @@ -1,4 +1,4 @@ - + @@ -13,7 +13,7 @@ - Stop a running apphost or the specified resource. + Stop a running apphost. Zatrzymaj uruchomiony host aplikacji Wyszukaj. @@ -52,11 +52,6 @@ The {0} and {1} options cannot be used together. - - The {0} option cannot be used with a resource argument. - The {0} option cannot be used with a resource argument. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.pt-BR.xlf b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.pt-BR.xlf index f2727f8be72..1043d24ea40 100644 --- a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.pt-BR.xlf +++ b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.pt-BR.xlf @@ -1,4 +1,4 @@ - + @@ -13,7 +13,7 @@ - Stop a running apphost or the specified resource. + Stop a running apphost. Pare um AppHost Aspire em execução. @@ -52,11 +52,6 @@ The {0} and {1} options cannot be used together. - - The {0} option cannot be used with a resource argument. - The {0} option cannot be used with a resource argument. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.ru.xlf b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.ru.xlf index 566a65faff3..e7062c8526f 100644 --- a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.ru.xlf +++ b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.ru.xlf @@ -1,4 +1,4 @@ - + @@ -13,7 +13,7 @@ - Stop a running apphost or the specified resource. + Stop a running apphost. Остановить запущенный хост приложений Aspire. @@ -52,11 +52,6 @@ The {0} and {1} options cannot be used together. - - The {0} option cannot be used with a resource argument. - The {0} option cannot be used with a resource argument. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.tr.xlf b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.tr.xlf index b9ff00ce107..e73b952181d 100644 --- a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.tr.xlf +++ b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.tr.xlf @@ -1,4 +1,4 @@ - + @@ -13,7 +13,7 @@ - Stop a running apphost or the specified resource. + Stop a running apphost. Çalışan bir Aspire apphost'unu durdurun. @@ -52,11 +52,6 @@ The {0} and {1} options cannot be used together. - - The {0} option cannot be used with a resource argument. - The {0} option cannot be used with a resource argument. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.zh-Hans.xlf b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.zh-Hans.xlf index 0642c4d7c1b..ef09b74f363 100644 --- a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.zh-Hans.xlf +++ b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.zh-Hans.xlf @@ -1,4 +1,4 @@ - + @@ -13,7 +13,7 @@ - Stop a running apphost or the specified resource. + Stop a running apphost. 停止一个正在运行的 Aspire AppHost。 @@ -52,11 +52,6 @@ The {0} and {1} options cannot be used together. - - The {0} option cannot be used with a resource argument. - The {0} option cannot be used with a resource argument. - - \ No newline at end of file diff --git a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.zh-Hant.xlf b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.zh-Hant.xlf index 282d8f5f69d..97ea62d05d9 100644 --- a/src/Aspire.Cli/Resources/xlf/StopCommandStrings.zh-Hant.xlf +++ b/src/Aspire.Cli/Resources/xlf/StopCommandStrings.zh-Hant.xlf @@ -1,4 +1,4 @@ - + @@ -13,7 +13,7 @@ - Stop a running apphost or the specified resource. + Stop a running apphost. 停止正在執行的 Aspire apphost。 @@ -52,11 +52,6 @@ The {0} and {1} options cannot be used together. - - The {0} option cannot be used with a resource argument. - The {0} option cannot be used with a resource argument. - - \ No newline at end of file diff --git a/tests/Aspire.Cli.Tests/Commands/ResourceCommandTests.cs b/tests/Aspire.Cli.Tests/Commands/ResourceCommandTests.cs index afde5158d15..ec6ae33b66e 100644 --- a/tests/Aspire.Cli.Tests/Commands/ResourceCommandTests.cs +++ b/tests/Aspire.Cli.Tests/Commands/ResourceCommandTests.cs @@ -18,7 +18,7 @@ public async Task ResourceCommand_Help_Works() var provider = services.BuildServiceProvider(); var command = provider.GetRequiredService(); - var result = command.Parse("command --help"); + var result = command.Parse("resource --help"); var exitCode = await result.InvokeAsync().DefaultTimeout(); @@ -33,7 +33,7 @@ public async Task ResourceCommand_RequiresResourceArgument() var provider = services.BuildServiceProvider(); var command = provider.GetRequiredService(); - var result = command.Parse("command"); + var result = command.Parse("resource"); // Missing required argument should fail var exitCode = await result.InvokeAsync().DefaultTimeout(); @@ -48,7 +48,7 @@ public async Task ResourceCommand_RequiresCommandArgument() var provider = services.BuildServiceProvider(); var command = provider.GetRequiredService(); - var result = command.Parse("command myresource"); + var result = command.Parse("resource myresource"); // Missing required command argument should fail var exitCode = await result.InvokeAsync().DefaultTimeout(); @@ -63,7 +63,7 @@ public async Task ResourceCommand_AcceptsBothArguments() var provider = services.BuildServiceProvider(); var command = provider.GetRequiredService(); - var result = command.Parse("command myresource my-command --help"); + var result = command.Parse("resource myresource my-command --help"); var exitCode = await result.InvokeAsync().DefaultTimeout(); Assert.Equal(ExitCodeConstants.Success, exitCode); @@ -77,14 +77,39 @@ public async Task ResourceCommand_AcceptsProjectOption() var provider = services.BuildServiceProvider(); var command = provider.GetRequiredService(); - var result = command.Parse("command myresource my-command --apphost /path/to/project.csproj --help"); + var result = command.Parse("resource myresource my-command --apphost /path/to/project.csproj --help"); var exitCode = await result.InvokeAsync().DefaultTimeout(); Assert.Equal(ExitCodeConstants.Success, exitCode); } [Fact] - public async Task ResourceCommand_AcceptsKnownCommandNames() + public async Task ResourceCommand_AcceptsWellKnownCommandNames() + { + using var workspace = TemporaryWorkspace.Create(outputHelper); + var services = CliTestHelper.CreateServiceCollection(workspace, outputHelper); + var provider = services.BuildServiceProvider(); + + var command = provider.GetRequiredService(); + + // Test with start + var startResult = command.Parse("resource myresource start --help"); + var startExitCode = await startResult.InvokeAsync().DefaultTimeout(); + Assert.Equal(ExitCodeConstants.Success, startExitCode); + + // Test with stop + var stopResult = command.Parse("resource myresource stop --help"); + var stopExitCode = await stopResult.InvokeAsync().DefaultTimeout(); + Assert.Equal(ExitCodeConstants.Success, stopExitCode); + + // Test with restart + var restartResult = command.Parse("resource myresource restart --help"); + var restartExitCode = await restartResult.InvokeAsync().DefaultTimeout(); + Assert.Equal(ExitCodeConstants.Success, restartExitCode); + } + + [Fact] + public async Task ResourceCommand_AcceptsBackchannelCommandNames() { using var workspace = TemporaryWorkspace.Create(outputHelper); var services = CliTestHelper.CreateServiceCollection(workspace, outputHelper); @@ -93,18 +118,32 @@ public async Task ResourceCommand_AcceptsKnownCommandNames() var command = provider.GetRequiredService(); // Test with resource-start - var startResult = command.Parse("command myresource resource-start --help"); + var startResult = command.Parse("resource myresource resource-start --help"); var startExitCode = await startResult.InvokeAsync().DefaultTimeout(); Assert.Equal(ExitCodeConstants.Success, startExitCode); // Test with resource-stop - var stopResult = command.Parse("command myresource resource-stop --help"); + var stopResult = command.Parse("resource myresource resource-stop --help"); var stopExitCode = await stopResult.InvokeAsync().DefaultTimeout(); Assert.Equal(ExitCodeConstants.Success, stopExitCode); // Test with resource-restart - var restartResult = command.Parse("command myresource resource-restart --help"); + var restartResult = command.Parse("resource myresource resource-restart --help"); var restartExitCode = await restartResult.InvokeAsync().DefaultTimeout(); Assert.Equal(ExitCodeConstants.Success, restartExitCode); } + + [Fact] + public async Task ResourceCommand_AcceptsProjectOptionWithStart() + { + using var workspace = TemporaryWorkspace.Create(outputHelper); + var services = CliTestHelper.CreateServiceCollection(workspace, outputHelper); + var provider = services.BuildServiceProvider(); + + var command = provider.GetRequiredService(); + var result = command.Parse("resource myresource start --apphost /path/to/project.csproj --help"); + + var exitCode = await result.InvokeAsync().DefaultTimeout(); + Assert.Equal(ExitCodeConstants.Success, exitCode); + } } diff --git a/tests/Aspire.Cli.Tests/Commands/RestartCommandTests.cs b/tests/Aspire.Cli.Tests/Commands/RestartCommandTests.cs deleted file mode 100644 index 952ac8ef23d..00000000000 --- a/tests/Aspire.Cli.Tests/Commands/RestartCommandTests.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Aspire.Cli.Commands; -using Aspire.Cli.Tests.Utils; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.AspNetCore.InternalTesting; - -namespace Aspire.Cli.Tests.Commands; - -public class RestartCommandTests(ITestOutputHelper outputHelper) -{ - [Fact] - public async Task RestartCommand_Help_Works() - { - using var workspace = TemporaryWorkspace.Create(outputHelper); - var services = CliTestHelper.CreateServiceCollection(workspace, outputHelper); - var provider = services.BuildServiceProvider(); - - var command = provider.GetRequiredService(); - var result = command.Parse("restart --help"); - - var exitCode = await result.InvokeAsync().DefaultTimeout(); - - Assert.Equal(ExitCodeConstants.Success, exitCode); - } - - [Fact] - public async Task RestartCommand_RequiresResourceArgument() - { - using var workspace = TemporaryWorkspace.Create(outputHelper); - var services = CliTestHelper.CreateServiceCollection(workspace, outputHelper); - var provider = services.BuildServiceProvider(); - - var command = provider.GetRequiredService(); - var result = command.Parse("restart"); - - // Missing required argument should fail - var exitCode = await result.InvokeAsync().DefaultTimeout(); - Assert.NotEqual(ExitCodeConstants.Success, exitCode); - } - - [Fact] - public async Task RestartCommand_AcceptsResourceArgument() - { - using var workspace = TemporaryWorkspace.Create(outputHelper); - var services = CliTestHelper.CreateServiceCollection(workspace, outputHelper); - var provider = services.BuildServiceProvider(); - - var command = provider.GetRequiredService(); - var result = command.Parse("restart myresource --help"); - - var exitCode = await result.InvokeAsync().DefaultTimeout(); - Assert.Equal(ExitCodeConstants.Success, exitCode); - } - - [Fact] - public async Task RestartCommand_AcceptsProjectOption() - { - using var workspace = TemporaryWorkspace.Create(outputHelper); - var services = CliTestHelper.CreateServiceCollection(workspace, outputHelper); - var provider = services.BuildServiceProvider(); - - var command = provider.GetRequiredService(); - var result = command.Parse("restart myresource --apphost /path/to/project.csproj --help"); - - var exitCode = await result.InvokeAsync().DefaultTimeout(); - Assert.Equal(ExitCodeConstants.Success, exitCode); - } -} diff --git a/tests/Aspire.Cli.Tests/Commands/RunCommandTests.cs b/tests/Aspire.Cli.Tests/Commands/RunCommandTests.cs index f9c95c506be..56d1e6e6346 100644 --- a/tests/Aspire.Cli.Tests/Commands/RunCommandTests.cs +++ b/tests/Aspire.Cli.Tests/Commands/RunCommandTests.cs @@ -1479,6 +1479,21 @@ public async Task RunCommand_WithNoBuildAndWatchModeEnabled_ReturnsInvalidComman Assert.Equal(ExitCodeConstants.InvalidCommand, exitCode); } + [Fact] + public void RunCommand_ForwardsUnmatchedTokensToAppHost() + { + using var workspace = TemporaryWorkspace.Create(outputHelper); + var services = CliTestHelper.CreateServiceCollection(workspace, outputHelper); + var provider = services.BuildServiceProvider(); + + var command = provider.GetRequiredService(); + var result = command.Parse("run -- --custom-arg value"); + + Assert.Empty(result.Errors); + Assert.Contains("--custom-arg", result.UnmatchedTokens); + Assert.Contains("value", result.UnmatchedTokens); + } + private sealed class TestFeatures : IFeatures { private readonly Dictionary _features = new(); diff --git a/tests/Aspire.Cli.Tests/Commands/StartCommandTests.cs b/tests/Aspire.Cli.Tests/Commands/StartCommandTests.cs index e6a7146d81a..e1ed2ee9abe 100644 --- a/tests/Aspire.Cli.Tests/Commands/StartCommandTests.cs +++ b/tests/Aspire.Cli.Tests/Commands/StartCommandTests.cs @@ -25,49 +25,6 @@ public async Task StartCommand_Help_Works() Assert.Equal(ExitCodeConstants.Success, exitCode); } - [Fact] - public async Task StartCommand_RequiresResourceArgument() - { - using var workspace = TemporaryWorkspace.Create(outputHelper); - var services = CliTestHelper.CreateServiceCollection(workspace, outputHelper); - var provider = services.BuildServiceProvider(); - - var command = provider.GetRequiredService(); - var result = command.Parse("start"); - - // Missing required argument should fail - var exitCode = await result.InvokeAsync().DefaultTimeout(); - Assert.NotEqual(ExitCodeConstants.Success, exitCode); - } - - [Fact] - public async Task StartCommand_AcceptsResourceArgument() - { - using var workspace = TemporaryWorkspace.Create(outputHelper); - var services = CliTestHelper.CreateServiceCollection(workspace, outputHelper); - var provider = services.BuildServiceProvider(); - - var command = provider.GetRequiredService(); - var result = command.Parse("start myresource --help"); - - var exitCode = await result.InvokeAsync().DefaultTimeout(); - Assert.Equal(ExitCodeConstants.Success, exitCode); - } - - [Fact] - public async Task StartCommand_AcceptsProjectOption() - { - using var workspace = TemporaryWorkspace.Create(outputHelper); - var services = CliTestHelper.CreateServiceCollection(workspace, outputHelper); - var provider = services.BuildServiceProvider(); - - var command = provider.GetRequiredService(); - var result = command.Parse("start myresource --apphost /path/to/project.csproj --help"); - - var exitCode = await result.InvokeAsync().DefaultTimeout(); - Assert.Equal(ExitCodeConstants.Success, exitCode); - } - [Fact] public async Task StartCommand_AcceptsNoBuildOption() { @@ -111,30 +68,17 @@ public async Task StartCommand_AcceptsIsolatedOption() } [Fact] - public async Task StartCommand_FormatOptionNotValidWithResource() + public void StartCommand_ForwardsUnmatchedTokensToAppHost() { using var workspace = TemporaryWorkspace.Create(outputHelper); var services = CliTestHelper.CreateServiceCollection(workspace, outputHelper); var provider = services.BuildServiceProvider(); var command = provider.GetRequiredService(); - var result = command.Parse("start myresource --format json"); + var result = command.Parse("start -- --custom-arg value"); - var exitCode = await result.InvokeAsync().DefaultTimeout(); - Assert.Equal(ExitCodeConstants.InvalidCommand, exitCode); - } - - [Fact] - public async Task StartCommand_IsolatedOptionNotValidWithResource() - { - using var workspace = TemporaryWorkspace.Create(outputHelper); - var services = CliTestHelper.CreateServiceCollection(workspace, outputHelper); - var provider = services.BuildServiceProvider(); - - var command = provider.GetRequiredService(); - var result = command.Parse("start myresource --isolated"); - - var exitCode = await result.InvokeAsync().DefaultTimeout(); - Assert.Equal(ExitCodeConstants.InvalidCommand, exitCode); + Assert.Empty(result.Errors); + Assert.Contains("--custom-arg", result.UnmatchedTokens); + Assert.Contains("value", result.UnmatchedTokens); } } diff --git a/tests/Aspire.Cli.Tests/Commands/StopCommandTests.cs b/tests/Aspire.Cli.Tests/Commands/StopCommandTests.cs new file mode 100644 index 00000000000..79e15c4ac71 --- /dev/null +++ b/tests/Aspire.Cli.Tests/Commands/StopCommandTests.cs @@ -0,0 +1,41 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Aspire.Cli.Commands; +using Aspire.Cli.Tests.Utils; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.AspNetCore.InternalTesting; + +namespace Aspire.Cli.Tests.Commands; + +public class StopCommandTests(ITestOutputHelper outputHelper) +{ + [Fact] + public async Task StopCommand_Help_Works() + { + using var workspace = TemporaryWorkspace.Create(outputHelper); + var services = CliTestHelper.CreateServiceCollection(workspace, outputHelper); + var provider = services.BuildServiceProvider(); + + var command = provider.GetRequiredService(); + var result = command.Parse("stop --help"); + + var exitCode = await result.InvokeAsync().DefaultTimeout(); + + Assert.Equal(ExitCodeConstants.Success, exitCode); + } + + [Fact] + public async Task StopCommand_RejectsPositionalResourceArgument() + { + using var workspace = TemporaryWorkspace.Create(outputHelper); + var services = CliTestHelper.CreateServiceCollection(workspace, outputHelper); + var provider = services.BuildServiceProvider(); + + var command = provider.GetRequiredService(); + var result = command.Parse("stop myresource"); + + var exitCode = await result.InvokeAsync().DefaultTimeout(); + Assert.NotEqual(ExitCodeConstants.Success, exitCode); + } +} diff --git a/tests/Aspire.Cli.Tests/Utils/CliTestHelper.cs b/tests/Aspire.Cli.Tests/Utils/CliTestHelper.cs index 32ef1a8de78..2546f6bd1ba 100644 --- a/tests/Aspire.Cli.Tests/Utils/CliTestHelper.cs +++ b/tests/Aspire.Cli.Tests/Utils/CliTestHelper.cs @@ -169,7 +169,6 @@ public static IServiceCollection CreateServiceCollection(TemporaryWorkspace work services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient();