(cmd *cobra.Command, f *Flag, value *string, defaultValue string, filename string, infoFn func(), tempFileFn func(string), isUpdate bool)
| 279 | } |
| 280 | |
| 281 | func openEditorFlag(cmd *cobra.Command, f *Flag, value *string, defaultValue string, filename string, infoFn func(), tempFileFn func(string), isUpdate bool) error { |
| 282 | if shouldAsk(cmd, f, false) { // Always open the editor on update. |
| 283 | if isUpdate { |
| 284 | return openUpdateEditor(f, value, defaultValue, filename) |
| 285 | } |
| 286 | return openCreateEditor(value, defaultValue, filename, infoFn, tempFileFn) |
| 287 | } |
| 288 | |
| 289 | return nil |
| 290 | } |
| 291 | |
| 292 | func registerString(cmd *cobra.Command, f *Flag, value *string, defaultValue string, isUpdate bool) { |
| 293 | cmd.Flags().StringVarP(value, f.LongForm, f.ShortForm, defaultValue, f.Help) |
no test coverage detected