aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoop Kiefte <ikojba@gmail.com>2023-09-28 02:13:49 +0100
committerJoop Kiefte <ikojba@gmail.com>2023-09-28 02:13:49 +0100
commitd6b84a0e738c89c4d699754cd03db3bc6dbfb900 (patch)
treeb192eadfa0e2b0e41f91981d88db042eb6b7070f
parentf9e7812c4addfa6ed04bde24c5435b664b875828 (diff)
Simplify menu for continuous usage
-rw-r--r--main.go30
1 files changed, 12 insertions, 18 deletions
diff --git a/main.go b/main.go
index 2bf000e..1a5a72b 100644
--- a/main.go
+++ b/main.go
@@ -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)