Rename commands and clean up filename code

This commit is contained in:
The Magician 2025-03-25 11:58:37 +00:00
parent 0a52dde4f6
commit 556ef2dd78
1 changed files with 6 additions and 3 deletions

View File

@ -15,7 +15,7 @@ import (
const ( const (
UpdateSubcommand string = "update" UpdateSubcommand string = "update"
CreateStorageAreaSubcommand string = "createstorage" CreateStorageAreaSubcommand string = "create-storage"
StoreSubcommand string = "store" StoreSubcommand string = "store"
ImportSubcommand string = "import" ImportSubcommand string = "import"
SearchPrintingsSubcommand string = "search-printings" SearchPrintingsSubcommand string = "search-printings"
@ -81,9 +81,10 @@ func main() {
fmt.Printf("%d\n", cardLocationId) fmt.Printf("%d\n", cardLocationId)
break break
case ImportSubcommand: case ImportSubcommand:
importCmd := flag.NewFlagSet(ImportSubcommand, flag.ExitOnError) importCmd := flag.NewFlagSet(ImportSubcommand, flag.ExitOnError)
storageArea := importCmd.String("storagearea", "", storageArea := importCmd.String("storage-area", "",
"The name of the StorageArea where cards should be imported.") "The name of the StorageArea where cards should be imported.")
importCmd.Parse(flag.Args()[1:]) importCmd.Parse(flag.Args()[1:])
@ -95,12 +96,14 @@ func main() {
} }
logic.Check(err) logic.Check(err)
delverLensCards, err := delverlens.ParseExportFile(importCmd.Args()[0]) filename := importCmd.Args()[0]
delverLensCards, err := delverlens.ParseExportFile(filename)
logic.Check(err) logic.Check(err)
err = logic.ImportDelverLensCards(db, delverLensCards, storageAreaId) err = logic.ImportDelverLensCards(db, delverLensCards, storageAreaId)
logic.Check(err) logic.Check(err)
break break
/* /*
TODO: Rewrite this to search Blueprints TODO: Rewrite this to search Blueprints
case SearchPrintingsSubcommand: case SearchPrintingsSubcommand: