aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-10-08 12:08:22 +0200
committern-peugnet <n.peugnet@free.fr>2021-10-08 12:08:22 +0200
commitbe1ad1c114b77b654bd3e79fdb18b5d5cf93ddd1 (patch)
tree0845018555efaf45b8f171c0deeb3d258dfb9c36 /main.go
parent459343932d9673fc69ce1363ccb70d5f78f2e3e7 (diff)
downloaddna-backup-be1ad1c114b77b654bd3e79fdb18b5d5cf93ddd1.tar.gz
dna-backup-be1ad1c114b77b654bd3e79fdb18b5d5cf93ddd1.zip
add chunkSize parameter to cli
Diffstat (limited to 'main.go')
-rw-r--r--main.go10
1 files changed, 6 insertions, 4 deletions
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
}