// buildSvcDeleteCmd builds the command to delete application(s).
buildSvcDeleteCmd builds the command to delete application(s).
// buildSvcDeleteCmd builds the command to delete application ( s ) .
func buildSvcDeleteCmd() *cobra.Command {
	vars := deleteSvcVars{}
	cmd := &cobra.Command{
		Use:   "delete",
		Short: "Deletes a service from an application.",
		Example: `
  Delete the "test" service from the application.
  /code $ copilot svc delete --name test
  Delete the "test" service from just the prod environment.
  /code $ copilot svc delete --name test --env prod
  Delete the "test" service without confirmation prompt.
  /code $ copilot svc delete --name test --yes`,
		RunE: runCmdE(func(cmd *cobra.Command, args []string) error {
			opts, err := newDeleteSvcOpts(vars)
			if err != nil {
				return err
			}
			if err := opts.Validate(); err != nil {
				return err
			}
			if err := opts.Ask(); err != nil {
				return err
			}
			if err := opts.Execute(); err != nil {
				return err
			}
			log.Infoln("Recommended follow-up actions:")
			for _, followup := range opts.RecommendedActions() {
				log.Infof("- %s\n", followup)
			}
			return nil
		}),
	}
	cmd.Flags().StringVarP(&vars.appName, appFlag, appFlagShort, tryReadingAppName(), appFlagDescription)
	cmd.Flags().StringVarP(&vars.name, nameFlag, nameFlagShort, "", svcFlagDescription)
	cmd.Flags().StringVarP(&vars.envName, envFlag, envFlagShort, "", envFlagDescription)
	cmd.Flags().BoolVar(&vars.skipConfirmation, yesFlag, false, yesFlagDescription)
	return cmd
}
func buildSvcDeleteCmd ( ) * cobra . Command { vars := deleteSvcVars { } cmd := & cobra . Command { Use : " " , Short : " " , Example : `
  Delete the "test" service from the application.
  /code $ copilot svc delete --name test

  Delete the "test" service from just the prod environment.
  /code $ copilot svc delete --name test --env prod

  Delete the "test" service without confirmation prompt.
  /code $ copilot svc delete --name test --yes` , RunE : runCmdE ( func ( cmd * cobra . Command , args [ ] string ) error { opts , err := newDeleteSvcOpts ( vars ) if err != nil { return err } if err := opts . Validate ( ) ; err != nil { return err } if err := opts . Ask ( ) ; err != nil { return err } if err := opts . Execute ( ) ; err != nil { return err } log . Infoln ( " " ) for _ , followup := range opts . RecommendedActions ( ) { log . Infof ( " \n " , followup ) } return nil } ) , } cmd . Flags ( ) . StringVarP ( & vars . appName , appFlag , appFlagShort , tryReadingAppName ( ) , appFlagDescription ) cmd . Flags ( ) . StringVarP ( & vars . name , nameFlag , nameFlagShort , " " , svcFlagDescription ) cmd . Flags ( ) . StringVarP ( & vars . envName , envFlag , envFlagShort , " " , envFlagDescription ) cmd . Flags ( ) . BoolVar ( & vars . skipConfirmation , yesFlag , false , yesFlagDescription ) return cmd }
buildSvcDeleteCmd builds the command to delete application(s).
buildSvcDeleteCmd builds the command to delete application ( s ) .