diff options
author | Joop Kiefte <ikojba@gmail.com> | 2023-09-28 02:13:49 +0100 |
---|---|---|
committer | Joop Kiefte <ikojba@gmail.com> | 2023-09-28 02:13:49 +0100 |
commit | d6b84a0e738c89c4d699754cd03db3bc6dbfb900 (patch) | |
tree | b192eadfa0e2b0e41f91981d88db042eb6b7070f | |
parent | f9e7812c4addfa6ed04bde24c5435b664b875828 (diff) |
Simplify menu for continuous usage
-rw-r--r-- | main.go | 30 |
1 files changed, 12 insertions, 18 deletions
@@ -63,12 +63,6 @@ Running debby with any other arguments will run it as a dolt command.` RunSQL(query, "") case 2: if table == "" { - // List tables sequentially - fmt.Print("Available tables: ") - for _, t := range tables { - fmt.Printf(" [ %s ]", t) - } - fmt.Println() // Request table name fmt.Print("Enter your table name: ") fmt.Scanln(&table) @@ -96,20 +90,20 @@ Running debby with any other arguments will run it as a dolt command.` if noninteractive { return } - - // End of display - fmt.Print("Press enter to continue...") - fmt.Scanln() - // Clear screen - fmt.Print("\033[H\033[2J") - // Reset choice choice = 0 // Print menu - fmt.Println("1. Run query") - fmt.Println("2. Edit table") - fmt.Println("3. Execute Dolt command") - fmt.Println("4. Exit") - fmt.Print("Enter your choice: ") + + // List tables sequentially + fmt.Print("Tables: ") + for _, t := range tables { + fmt.Printf(" %s -", t) + } + fmt.Println() + fmt.Print("1. Run query ") + fmt.Print("2. Edit table ") + fmt.Print("3. Execute Dolt command ") + fmt.Print("4. Exit ") + fmt.Print("- Enter your choice: ") // Read user input fmt.Scanln(&choice) |