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:
@@ -58,6 +58,14 @@ func (v *Vaultik) Prune(opts *PruneOptions) error {
|
||||
if err := v.EnsureStorageBinding(); err != nil {
|
||||
return err
|
||||
}
|
||||
// First reconcile local snapshot records against remote metadata:
|
||||
// any local snapshot whose manifest is missing from the destination
|
||||
// store is treated as gone. This used to be the separate 'snapshot
|
||||
// cleanup' command and is now folded in so a single 'vaultik prune'
|
||||
// gets the local index fully back in sync with the destination.
|
||||
if err := v.CleanupLocalSnapshots(); err != nil {
|
||||
return fmt.Errorf("reconciling local snapshots with remote: %w", err)
|
||||
}
|
||||
if _, err := v.PruneDatabase(); err != nil {
|
||||
return fmt.Errorf("pruning local database: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user