| 53 | } |
| 54 | |
| 55 | func New(editorCmd string, io *iostreams.IOStreams) Prompter { |
| 56 | if io.ExperimentalPrompterEnabled() { |
| 57 | return &huhPrompter{ |
| 58 | stdin: io.In, |
| 59 | stdout: io.Out, |
| 60 | stderr: io.ErrOut, |
| 61 | editorCmd: editorCmd, |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | if io.AccessiblePrompterEnabled() { |
| 66 | return &accessiblePrompter{ |
| 67 | stdin: io.In, |
| 68 | stdout: io.Out, |
| 69 | stderr: io.ErrOut, |
| 70 | editorCmd: editorCmd, |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | return &surveyPrompter{ |
| 75 | prompter: ghPrompter.New(io.In, io.Out, io.ErrOut), |
| 76 | stdin: io.In, |
| 77 | stdout: io.Out, |
| 78 | stderr: io.ErrOut, |
| 79 | editorCmd: editorCmd, |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | type accessiblePrompter struct { |
| 84 | stdin ghPrompter.FileReader |