mirror of
https://github.com/kopia/kopia.git
synced 2026-01-24 14:28:06 -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
29 lines
635 B
Go
29 lines
635 B
Go
package cli
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/kopia/kopia/repo"
|
|
)
|
|
|
|
var (
|
|
contentRemoveCommand = contentCommands.Command("remove", "Remove content").Alias("rm")
|
|
|
|
contentRemoveIDs = contentRemoveCommand.Arg("id", "IDs of content to remove").Required().Strings()
|
|
)
|
|
|
|
func runContentRemoveCommand(ctx context.Context, rep *repo.Repository) error {
|
|
for _, contentID := range toContentIDs(*contentRemoveIDs) {
|
|
if err := rep.Content.DeleteContent(contentID); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
setupShowCommand(contentRemoveCommand)
|
|
contentRemoveCommand.Action(repositoryAction(runContentRemoveCommand))
|
|
}
|