diff options
author | n-peugnet <n.peugnet@free.fr> | 2021-10-08 12:08:22 +0200 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2021-10-08 12:08:22 +0200 |
commit | be1ad1c114b77b654bd3e79fdb18b5d5cf93ddd1 (patch) | |
tree | 0845018555efaf45b8f171c0deeb3d258dfb9c36 /main.go | |
parent | 459343932d9673fc69ce1363ccb70d5f78f2e3e7 (diff) | |
download | dna-backup-be1ad1c114b77b654bd3e79fdb18b5d5cf93ddd1.tar.gz dna-backup-be1ad1c114b77b654bd3e79fdb18b5d5cf93ddd1.zip |
add chunkSize parameter to cli
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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 } |