From be1ad1c114b77b654bd3e79fdb18b5d5cf93ddd1 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Fri, 8 Oct 2021 12:08:22 +0200 Subject: add chunkSize parameter to cli --- main.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index f1bb1d8..499c4c2 100644 --- a/main.go +++ b/main.go @@ -22,8 +22,9 @@ const ( ) var ( - logLevel int - format string + logLevel int + chunkSize int + format string ) var commit = command{flag.NewFlagSet("commit", flag.ExitOnError), commitMain, @@ -51,6 +52,7 @@ func init() { // setup subcommands for _, s := range subcommands { s.Flag.IntVar(&logLevel, "v", 3, "log verbosity level (0-4)") + s.Flag.IntVar(&chunkSize, "c", 8<<10, "chunk size") } } @@ -85,7 +87,7 @@ func commitMain(args []string) error { } source := args[0] dest := args[1] - repo := repo.NewRepo(dest) + repo := repo.NewRepo(dest, chunkSize) repo.Commit(source) return nil } @@ -96,7 +98,7 @@ func restoreMain(args []string) error { } source := args[0] dest := args[1] - repo := repo.NewRepo(source) + repo := repo.NewRepo(source, chunkSize) repo.Restore(dest) return nil } -- cgit v1.2.3