Refactoring code to prep for UI devlopment

Im procrastinating...
This commit is contained in:
2026-04-28 14:49:41 -06:00
parent e7f967c6bd
commit d895978ea0
3 changed files with 15 additions and 9 deletions

22
main.go
View File

@@ -5,14 +5,10 @@ import (
"os"
)
var c = readCfg(fmConfig)
var c = readCfg("config.yml")
func main() {
if len(os.Args) == 1 {
fmt.Println("Use 'start', 'stop', or 'backup' command")
fmt.Println("ex. factoryman start")
fmt.Println("To configure edit 'conifg.yml'")
} else if len(os.Args) > 1 {
func cli() {
if len(os.Args) > 1 {
switch os.Args[1] {
case "start":
startStopServer("start", c)
@@ -44,3 +40,15 @@ func main() {
fmt.Println("To configure edit 'conifg.yml'")
}
}
func switchMode() { // cli command mode or GUI mode
if len(os.Args) == 1 {
fmt.Println("Starting GUI mode...")
} else if len(os.Args) > 1 {
cli()
}
}
func main() {
switchMode()
}