Consolidate CLI verbs; retire overlapping commands
The verb surface accumulated overlapping cleanup commands. Consolidate so each cleanup verb has one meaning: - Rename 'database purge' -> 'database delete'. The command removes the SQLite file entirely; "purge" wrongly suggested purging contents. - Fold 'snapshot cleanup' into 'prune'. Prune now runs three passes: reconcile local snapshots against the remote (previously the standalone cleanup command), drop orphaned local rows, then delete unreferenced remote blobs. One command, one mental model. - Delete 'store info'. Its output was a strict subset of 'remote info', which already prints storage type + location. Any user reaching for either should reach for 'remote info'. - Drop 'snapshot remove --all'. It duplicated 'remote nuke --force'. 'remote nuke' is the single supported entry point for wiping the destination store. Also update the storage-binding error message to reference the new 'vaultik database delete' name.
This commit is contained in:
@@ -291,7 +291,7 @@ func TestRemoveAllSnapshots_RequiresForce(t *testing.T) {
|
||||
|
||||
tv := vaultik.NewForTesting(store)
|
||||
|
||||
opts := &vaultik.RemoveOptions{All: true} // No Force
|
||||
opts := &vaultik.RemoveOptions{} // No Force
|
||||
_, err := tv.RemoveAllSnapshots(opts)
|
||||
|
||||
assert.Error(t, err)
|
||||
@@ -310,7 +310,7 @@ func TestRemoveAllSnapshots_WithForce(t *testing.T) {
|
||||
|
||||
tv := vaultik.NewForTesting(store)
|
||||
|
||||
opts := &vaultik.RemoveOptions{All: true, Force: true}
|
||||
opts := &vaultik.RemoveOptions{Force: true}
|
||||
result, err := tv.RemoveAllSnapshots(opts)
|
||||
|
||||
require.NoError(t, err)
|
||||
@@ -342,7 +342,7 @@ func TestRemoveAllSnapshots_DryRun(t *testing.T) {
|
||||
// Default (no LocalOnly) enumerates the orphan remote keys, which
|
||||
// matches what NewForTesting has — local DB is empty, so the two
|
||||
// addManifest calls land as orphan remote keys.
|
||||
opts := &vaultik.RemoveOptions{All: true, Force: true, DryRun: true}
|
||||
opts := &vaultik.RemoveOptions{Force: true, DryRun: true}
|
||||
result, err := tv.RemoveAllSnapshots(opts)
|
||||
|
||||
require.NoError(t, err)
|
||||
@@ -362,7 +362,7 @@ func TestRemoveAllSnapshots_NoSnapshots(t *testing.T) {
|
||||
|
||||
tv := vaultik.NewForTesting(store)
|
||||
|
||||
opts := &vaultik.RemoveOptions{All: true, Force: true}
|
||||
opts := &vaultik.RemoveOptions{Force: true}
|
||||
result, err := tv.RemoveAllSnapshots(opts)
|
||||
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user