Skip to content
Open
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
3 changes: 2 additions & 1 deletion internal/pkg/cli/app_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,10 @@ func buildAppDeleteCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "delete",
Short: "Delete all resources associated with the application.",
Args: cobra.NoArgs,
Example: `
Force delete the application with environments "test" and "prod".
/code $ copilot app delete --yes`,
/code $ copilot app delete --name phonetool --yes`,
RunE: runCmdE(func(cmd *cobra.Command, args []string) error {
opts, err := newDeleteAppOpts(vars)
if err != nil {
Expand Down
12 changes: 12 additions & 0 deletions internal/pkg/cli/app_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package cli
import (
"errors"
"fmt"
"io"
"testing"

"github.com/aws/aws-sdk-go/aws/session"
Expand All @@ -21,6 +22,17 @@ import (
"github.com/stretchr/testify/require"
)

func TestAppDeleteCommandRejectsPositionalAppName(t *testing.T) {
cmd := buildAppDeleteCommand()
cmd.SetArgs([]string{"phonetool"})
cmd.SetOut(io.Discard)
cmd.SetErr(io.Discard)

err := cmd.Execute()

require.EqualError(t, err, `unknown command "phonetool" for "delete"`)
}

type deleteAppMocks struct {
spinner *mocks.Mockprogress
store *mocks.Mockstore
Expand Down
14 changes: 9 additions & 5 deletions site/content/docs/commands/app-delete.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ $ copilot app delete [flags]
## What are the flags?

```
-h, --help help for delete
--yes Skips confirmation prompt.
-h, --help help for delete
-n, --name string Name of the application.
--yes Skips confirmation prompt.
```

## Examples
Force delete the application.
!!!warning "Use `--name` for application names"
`copilot app delete` does not accept a positional application name. To delete a specific application, pass the name with `--name`.

Force delete an application named "phonetool".
```console
$ copilot app delete --yes
```
$ copilot app delete --name phonetool --yes
```
12 changes: 8 additions & 4 deletions site/content/docs/commands/app-delete.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ $ copilot app delete [flags]
## フラグ

```
-h, --help help for delete
--yes Skips confirmation prompt.
-h, --help help for delete
-n, --name string Name of the application.
--yes Skips confirmation prompt.
```

## 実行例
Application を強制的に削除します。
!!!warning "Application 名には `--name` を使用してください"
`copilot app delete` は位置引数の Application 名を受け付けません。特定の Application を削除するには、`--name` で名前を渡します。

"phonetool" という名前の Application を強制的に削除します。
```console
$ copilot app delete --yes
$ copilot app delete --name phonetool --yes
```