mirror of
https://codeberg.org/scip/anydb.git
synced 2025-12-17 04:20:59 +01:00
fixed read error and updated tests
This commit is contained in:
@@ -120,7 +120,7 @@ func (db *DB) List(attr *DbAttr) (DbEntries, error) {
|
|||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
return fmt.Errorf("failed to read from DB: %w", err)
|
return err
|
||||||
})
|
})
|
||||||
return entries, err
|
return entries, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ func Print(writer io.Writer, conf *cfg.Config, attr *app.DbAttr, entry *app.DbEn
|
|||||||
|
|
||||||
fmt.Println(string(jsonentry))
|
fmt.Println(string(jsonentry))
|
||||||
case "wide":
|
case "wide":
|
||||||
ListTable(writer, conf, app.DbEntries{*entry})
|
return ListTable(writer, conf, app.DbEntries{*entry})
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ exec anydb -f test.db list
|
|||||||
stdout foo.*bar
|
stdout foo.*bar
|
||||||
|
|
||||||
# wide list
|
# wide list
|
||||||
exec anydb -f test.db list -o wide
|
exec anydb -f test.db list -m wide
|
||||||
stdout 'plant.*now.*grey'
|
stdout 'plant.*now.*grey'
|
||||||
|
|
||||||
# list tagged
|
# list tagged
|
||||||
@@ -42,6 +42,13 @@ stdout grey
|
|||||||
exec anydb -f test.db list -t flower
|
exec anydb -f test.db list -t flower
|
||||||
! stdout grey
|
! stdout grey
|
||||||
|
|
||||||
|
# check json output
|
||||||
|
exec anydb -f test.db list -m json
|
||||||
|
stdout '^\[\{'
|
||||||
|
|
||||||
|
exec anydb -f test.db get color -m json
|
||||||
|
stdout '^\{'
|
||||||
|
|
||||||
# delete entry
|
# delete entry
|
||||||
exec anydb -f test.db del foo
|
exec anydb -f test.db del foo
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user