Working on adding a TUI

This commit is contained in:
2026-01-14 02:18:47 -07:00
parent b2c534f29b
commit 86ccf302ea
6 changed files with 213 additions and 11 deletions

30
main.go
View File

@@ -3,17 +3,43 @@ package main
import (
"fmt"
"os"
tea "github.com/charmbracelet/bubbletea"
)
var mmChouice string
func mainMenu() {
if len(os.Args) == 1 {
p := tea.NewProgram((initialmmModel()))
if _, err := p.Run(); err != nil {
fmt.Printf("Error starting TUI: %v", err)
os.Exit(1)
}
fmt.Println()
}
}
func main() {
c := readCfg(fmConfig)
if len(os.Args) > 1 {
if len(os.Args) == 1 {
mainMenu()
if mmChouice != "" {
if mmChouice == "start" {
fmt.Println("works: " + mmChouice)
}
// IM HERE -+-+-+-+-+-+-+-+-+-+-
}
} else if len(os.Args) > 1 {
switch os.Args[1] {
case "start":
startStopServer("start", c)
case "stop":
startStopServer("stop", c)
case "help", "h", "--help", "-h":
fmt.Printf("Start Server: %s start\nStop Server: %s stop\n", os.Args[0], os.Args[0])
fmt.Printf("Run backup\n\tFull backup: %s backup full", os.Args[0])
fmt.Printf("\n\tBackup saves: %s backup saves\n", os.Args[0])
case "backup":
if len(os.Args) > 2 {
switch os.Args[2] {