mirror of
https://github.com/kopia/kopia.git
synced 2026-01-28 00:08:04 -05:00
Also introduced strongly typed content.ID and manifest.ID (instead of string) This aligns identifiers across all layers of repository: blob.ID content.ID object.ID manifest.ID
27 lines
579 B
Go
27 lines
579 B
Go
package cli
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/kopia/kopia/repo"
|
|
)
|
|
|
|
var (
|
|
manifestRemoveCommand = manifestCommands.Command("rm", "Remove manifest items")
|
|
manifestRemoveItems = manifestRemoveCommand.Arg("item", "Items to remove").Required().Strings()
|
|
)
|
|
|
|
func runManifestRemoveCommand(ctx context.Context, rep *repo.Repository) error {
|
|
for _, it := range toManifestIDs(*manifestRemoveItems) {
|
|
if err := rep.Manifests.Delete(ctx, it); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
manifestRemoveCommand.Action(repositoryAction(runManifestRemoveCommand))
|
|
}
|