feat(cmd): made error messaging closer to coreutils

This commit is contained in:
Lewis Wynne 2025-12-17 14:13:46 +00:00
parent 221d4cd921
commit 60d74e5ec1
4 changed files with 62 additions and 27 deletions

View file

@ -71,7 +71,7 @@ func mv(cmd *cobra.Command, args []string) error {
if _, err := tx.Get(k); err == nil {
return fmt.Errorf("cannot move '%s': '%s' already exists > run with --force to overwrite", fromKey, toKey)
} else if err != badger.ErrKeyNotFound {
return err
return fmt.Errorf("cannot move '%s': %v", fromKey, err)
}
}
entry := badger.NewEntry(k, srcVal).WithMeta(srcMeta)