mirror of
https://github.com/kopia/kopia.git
synced 2026-01-25 06:48:48 -05:00
22 lines
562 B
Go
22 lines
562 B
Go
package cli
|
|
|
|
import (
|
|
kingpin "gopkg.in/alecthomas/kingpin.v2"
|
|
)
|
|
|
|
var (
|
|
blockRepackCommand = blockCommands.Command("repack", "Repackage small blocks into bigger ones")
|
|
blockRepackSizeThreshold = blockRepackCommand.Flag("max-size", "Max size of block to re-pack").Default("500000").Uint64()
|
|
)
|
|
|
|
func runBlockRepackAction(context *kingpin.ParseContext) error {
|
|
rep := mustOpenRepository(nil)
|
|
defer rep.Close() //nolint: errcheck
|
|
|
|
return rep.Blocks.Repackage(*blockRepackSizeThreshold)
|
|
}
|
|
|
|
func init() {
|
|
blockRepackCommand.Action(runBlockRepackAction)
|
|
}
|