File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,12 +34,27 @@ func StartInteractiveMode() {
3434
3535 for {
3636 fmt .Print ("scmd> " )
37- input , err := reader .ReadString ('\n' )
38- if err != nil {
39- fmt .Println ("Error reading input:" , err )
40- continue
37+
38+ // Multi-line input: accumulate lines until the user submits
39+ // by pressing Enter on an empty line (blank line = submit).
40+ // This lets users paste or type multi-line queries freely.
41+ var lines []string
42+ for {
43+ line , err := reader .ReadString ('\n' )
44+ if err != nil {
45+ fmt .Println ("Error reading input:" , err )
46+ break
47+ }
48+ trimmed := strings .TrimSpace (line )
49+ if trimmed == "" {
50+ // Empty line: submit whatever we have accumulated
51+ break
52+ }
53+ lines = append (lines , trimmed )
54+ fmt .Print (" ... " )
4155 }
4256
57+ input := strings .Join (lines , " " )
4358 input = strings .TrimSpace (input )
4459 if input == "" {
4560 continue
@@ -142,6 +157,8 @@ func printWelcome() {
142157 fmt .Println (" Comma-separated = OR: docker,kubernetes,postgresql" )
143158 fmt .Println (" Natural language: show me postgresql replication examples" )
144159 fmt .Println ()
160+ fmt .Println ("Input: Type or paste your query, then press Enter on an empty line to submit." )
161+ fmt .Println ()
145162}
146163
147164func processInteractiveCommand (input string ) string {
You can’t perform that action at this time.
0 commit comments