CaptureInputViaEditor is the high level function to use in this package in order to capture input from an editor. The arguments have been tailored for our use of strings mostly in the rest of the CLI even though internally we're using []byte.
(contents, pattern string, infoFn func(), fileCreatedFn func(string))
| 27 | // The arguments have been tailored for our use of strings mostly in the rest |
| 28 | // of the CLI even though internally we're using []byte. |
| 29 | func CaptureInputViaEditor(contents, pattern string, infoFn func(), fileCreatedFn func(string)) (result string, err error) { |
| 30 | v, err := defaultEditorPrompt.captureInput([]byte(contents), pattern, infoFn, fileCreatedFn) |
| 31 | return string(v), err |
| 32 | } |
| 33 | |
| 34 | type editorPrompt struct { |
| 35 | cmd string |
no test coverage detected