handleDefaultUpdateConfirmation centralizes the confirmation logic when the --default flag is provided. It returns (true, nil) when it's ok to proceed, (false, nil) when the user declined confirmation, or (false, err) when an error happened.
(actionOpts *action.ActionsOpts, name string)
| 186 | // is provided. It returns (true, nil) when it's ok to proceed, (false, nil) when the user |
| 187 | // declined confirmation, or (false, err) when an error happened. |
| 188 | func handleDefaultUpdateConfirmation(actionOpts *action.ActionsOpts, name string) (bool, error) { |
| 189 | if isDefaultCASBackendUpdateOption == nil { |
| 190 | return true, nil |
| 191 | } |
| 192 | |
| 193 | if *isDefaultCASBackendUpdateOption { |
| 194 | return confirmDefaultCASBackendOverride(actionOpts, name) |
| 195 | } |
| 196 | |
| 197 | return confirmDefaultCASBackendUnset(name, "You are setting the default CAS backend to false", actionOpts) |
| 198 | } |
no test coverage detected