Skip to content

Commit

Permalink
Adding more information about force and purge for down command (#251)
Browse files Browse the repository at this point in the history
provide a little more information for Down command
  • Loading branch information
vhvb1989 authored Aug 10, 2022
1 parent fd96b3e commit 49854e5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cli/azd/cmd/infra_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (a *infraDeleteAction) SetupFlags(
local *pflag.FlagSet,
) {
local.BoolVar(&a.forceDelete, "force", false, "Does not require confirmation before it deletes resources.")
local.BoolVar(&a.purgeDelete, "purge", false, "Permanently deletes resources that are soft-deleted by default (for example, key vaults).")
local.BoolVar(&a.purgeDelete, "purge", false, "Does not require confirmation before it permanently deletes resources that are soft-deleted by default (for example, key vaults).")
}

func (a *infraDeleteAction) Run(ctx context.Context, _ *cobra.Command, args []string, azdCtx *environment.AzdContext) error {
Expand Down Expand Up @@ -97,7 +97,10 @@ func (a *infraDeleteAction) Run(ctx context.Context, _ *cobra.Command, args []st
if len(allResources) > 0 && !a.forceDelete {
var ok bool
err := askOne(&survey.Confirm{
Message: fmt.Sprintf("This will delete %d resources, are you sure you want to continue?", len(allResources)),
Message: fmt.Sprintf(
"This will delete %d resources, are you sure you want to continue?\n"+
"You can use --force to skip this confirmation.",
len(allResources)),
Default: false,
}, &ok)
if err != nil {
Expand Down Expand Up @@ -138,8 +141,9 @@ func (a *infraDeleteAction) Run(ctx context.Context, _ *cobra.Command, args []st

if len(keyVaultsToPurge) > 0 && !purgeDelete {
fmt.Printf(""+
"This operation will delete %d Key Vaults. These Key Vaults have soft delete enabled allowing them to be recovered for a period \n"+
"of time after deletion. During this period, their names may not be reused.\n",
"This operation will delete and purge %d Key Vaults. These Key Vaults have soft delete enabled allowing them to be recovered for a period \n"+
"of time after deletion. During this period, their names may not be reused.\n"+
"You can use argument --purge to skip this confirmation.\n",
len(keyVaultsToPurge))
err := askOne(&survey.Confirm{
Message: "Would you like to *permanently* delete these Key Vaults instead, allowing their names to be reused?",
Expand Down

0 comments on commit 49854e5

Please sign in to comment.