// Ask prompts the user for any required flags.
Ask prompts the user for any required flags.
// Ask prompts the user for any required flags .
func (o *deleteSvcOpts) Ask() error {
	if err := o.askSvcName(); err != nil {
		return err
	}
	if o.skipConfirmation {
		return nil
	}
	deletePrompt := fmt.Sprintf(fmtSvcDeleteConfirmPrompt, o.name, o.appName)
	deleteConfirmHelp := svcDeleteConfirmHelp
	if o.envName != "" {
		deletePrompt = fmt.Sprintf(fmtSvcDeleteFromEnvConfirmPrompt, o.name, o.envName)
		deleteConfirmHelp = fmt.Sprintf(svcDeleteFromEnvConfirmHelp, o.envName)
	}
	deleteConfirmed, err := o.prompt.Confirm(
		deletePrompt,
		deleteConfirmHelp)
	if err != nil {
		return fmt.Errorf("svc delete confirmation prompt: %w", err)
	}
	if !deleteConfirmed {
		return errSvcDeleteCancelled
	}
	return nil
}
func ( o * deleteSvcOpts ) Ask ( ) error { if err := o . askSvcName ( ) ; err != nil { return err } if o . skipConfirmation { return nil } deletePrompt := fmt . Sprintf ( fmtSvcDeleteConfirmPrompt , o . name , o . appName ) deleteConfirmHelp := svcDeleteConfirmHelp if o . envName != " " { deletePrompt = fmt . Sprintf ( fmtSvcDeleteFromEnvConfirmPrompt , o . name , o . envName ) deleteConfirmHelp = fmt . Sprintf ( svcDeleteFromEnvConfirmHelp , o . envName ) } deleteConfirmed , err := o . prompt . Confirm ( deletePrompt , deleteConfirmHelp ) if err != nil { return fmt . Errorf ( " " , err ) } if ! deleteConfirmed { return errSvcDeleteCancelled } return nil }
Ask prompts the user for any required flags.
Ask prompts the user for any required flags .
// When there's no env name passed in, we'll completely // remove the service from the application. // When a customer provides a particular environment, // we'll just delete the service from that environment - // but keep it in the app.