Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions src/Aspire.Cli/Commands/DoCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,29 @@ public DoCommand(IDotNetCliRunner runner, IInteractionService interactionService
{
var step = result.GetValue(_stepArgument);
var listSteps = result.GetValue(s_listStepsOption);
if (string.IsNullOrEmpty(step) && !listSteps && !ExtensionHelper.IsExtensionHost(interactionService, out _, out _))
if (!string.IsNullOrEmpty(step))
{
result.AddError("The 'step' argument is required when not using --list-steps.");
return;
}

if (listSteps)
{
// `aspire do --list-steps` with no step has no meaningful scope: the listing for
// `do` is always relative to a target step. Surface a friendly error pointing at
// common starting steps and the docs rather than launching the AppHost and
// crashing mid-pipeline (see https://github.com/microsoft/aspire/issues/17526).
// This applies in the extension host too because `--list-steps` does not flow
// through the interactive step prompt in GetRunArgumentsAsync, so without this
// error the extension would still hit the original crash path.
result.AddError(DoCommandStrings.ListStepsRequiresStep);
return;
}

// For a plain `aspire do` invocation, the extension host prompts the user for a step
// later in GetRunArgumentsAsync, so don't add a validation error there.
if (!ExtensionHelper.IsExtensionHost(interactionService, out _, out _))
{
result.AddError(DoCommandStrings.StepArgumentRequired);
}
});
}
Expand Down
18 changes: 18 additions & 0 deletions src/Aspire.Cli/Resources/DoCommandStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/Aspire.Cli/Resources/DoCommandStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,10 @@
<data name="StepArgumentDescription" xml:space="preserve">
<value>The name of the step to execute</value>
</data>
<data name="StepArgumentRequired" xml:space="preserve">
<value>The 'step' argument is required.</value>
</data>
<data name="ListStepsRequiresStep" xml:space="preserve">
<value>The 'step' argument is required when using --list-steps. Example: 'aspire do deploy --list-steps'. Common starting steps are 'build', 'publish' and 'deploy'. See https://aspire.dev/reference/cli/commands/aspire-do/ for the full list of pipeline steps.</value>
</data>
</root>
12 changes: 11 additions & 1 deletion src/Aspire.Cli/Resources/xlf/DoCommandStrings.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoCommandStrings.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoCommandStrings.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoCommandStrings.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoCommandStrings.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoCommandStrings.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoCommandStrings.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoCommandStrings.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoCommandStrings.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoCommandStrings.ru.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoCommandStrings.tr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoCommandStrings.zh-Hans.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading