feat(parser): adds explicit DB parser for when we don't want a key - should probably reject keyinput on match

This commit is contained in:
Lewis Wynne 2025-11-06 22:47:01 +00:00
parent af049a6ade
commit fa224d9b38
2 changed files with 21 additions and 3 deletions

View file

@ -28,7 +28,7 @@ import (
// listCmd represents the set command
var listCmd = &cobra.Command{
Use: "list [@DB]",
Use: "list [DB]",
Short: "List the contents of a db.",
Args: cobra.MaximumNArgs(1),
RunE: list,
@ -38,7 +38,11 @@ func list(cmd *cobra.Command, args []string) error {
store := &Store{}
targetDB := "@default"
if len(args) == 1 {
targetDB = args[0]
dbName, err := store.parseDB(args[0], false)
if err != nil {
return err
}
targetDB = "@" + dbName
}
trans := TransactionArgs{