TheMathemagicians/sevenkeys/main.go

66 lines
1.3 KiB
Go

package main
import (
"sevenkeys/cli"
"sevenkeys/database"
"sevenkeys/figlet"
)
func main() {
db := database.GetDatabaseFromConfig("config.json")
figlet.ReadFigletFonts()
cli.ShowSplashScreen()
cli.RunUpdateCheck(db)
cli.MainCliLoop(db)
/*
var selectedCardId string
var selectedCardSearchOption string = "None"
var lastOutput string
for {
screen.Clear()
screen.MoveTopLeft()
fmt.Println("Storage location:", storageBox, "|", "Source:", source)
fmt.Println("Selected card:", selectedCardSearchOption, "ID:", selectedCardId)
if lastOutput != "" {
fmt.Println(lastOutput)
}
var action string
action = logic.GetResponse("[s]earch for card/[i]nsert selected card/[q]uit:")
switch action {
case "s":
selectedCardId, selectedCardSearchOption, err = logic.Search(searchOptions)
logic.Check(err)
storageLocation.CardPrintingId = selectedCardId
lastOutput = ""
continue
case "i":
if selectedCardId == "" {
lastOutput = "No selected card, please search for one."
continue
}
err = logic.StoreCard(db, storageLocation)
logic.Check(err)
lastOutput = "Inserted card: " + selectedCardSearchOption
break
case "q":
os.Exit(0)
default:
lastOutput = "Not a valid command: " + action
break
}
}
*/
}