package cli import ( "database/sql" "fmt" "io" "sevenkeys/database" "sevenkeys/logic" ) var ( cardStorageLocation database.CardStorageLocation selectedCardPrintingSearchLine string copiesInserted int ) func getInfoDisplay(info string) string { if info == "" { return "[EMPTY]" } return info } func showStorageInfo(w io.Writer, area database.StorageArea) { fmt.Fprint(w, "Selected Storage Area: ") if area.Name == "" { fmt.Fprint(w, "[None]\n") return } fmt.Fprintf(w, "%s (%s)\n", area.Name, area.Type) return } func showCopiesInserted() { fmt.Println("Copies inserted:", copiesInserted) } func insertSelectedCard(db *sql.DB) { if cardStorageLocation.CardPrintingId == "" { output = "No card selected, please [search] for a card printing." return } if cardStorageLocation.StorageBox == "" || cardStorageLocation.CardCondition == "" { cardStorageLocation.StorageBox = GetStringResponse("Storage location:") cardStorageLocation.CardCondition = GetStringResponse("Card condition:") } err := logic.StoreCard(db, cardStorageLocation) logic.Check(err) copiesInserted++ }