(p prompter.Prompter, io *iostreams.IOStreams)
| 261 | } |
| 262 | |
| 263 | func runMarkdownEditor(p prompter.Prompter, io *iostreams.IOStreams) error { |
| 264 | defaultText := "default text value" |
| 265 | |
| 266 | fmt.Fprintln(io.Out, "Demonstrating Markdown Editor with blanks allowed and default text") |
| 267 | editorText, err := p.MarkdownEditor("Edit your text:", defaultText, true) |
| 268 | if err != nil { |
| 269 | return err |
| 270 | } |
| 271 | fmt.Fprintf(io.Out, "Returned text: %s\n\n", editorText) |
| 272 | |
| 273 | fmt.Fprintln(io.Out, "Demonstrating Markdown Editor with blanks disallowed and default text") |
| 274 | editorText2, err := p.MarkdownEditor("Edit your text:", defaultText, false) |
| 275 | if err != nil { |
| 276 | return err |
| 277 | } |
| 278 | fmt.Fprintf(io.Out, "Returned text: %s\n\n", editorText2) |
| 279 | |
| 280 | fmt.Fprintln(io.Out, "Demonstrating Markdown Editor with blanks disallowed and no default text") |
| 281 | editorText3, err := p.MarkdownEditor("Edit your text:", "", false) |
| 282 | if err != nil { |
| 283 | return err |
| 284 | } |
| 285 | fmt.Fprintf(io.Out, "Returned text: %s\n", editorText3) |
| 286 | return nil |
| 287 | } |
nothing calls this directly
no test coverage detected