diff --git a/restic.go b/restic.go index 42cdd2f..04fd434 100644 --- a/restic.go +++ b/restic.go @@ -213,7 +213,7 @@ func (glo ResticGlobalOpts) ToArgs() (args []string) { args = maybeAddArgBool(args, "--no-lock", glo.NoLock) for key, value := range glo.Options { - args = append(args, fmt.Sprintf("--option %s='%s'", key, value)) + args = append(args, "--option", fmt.Sprintf("%s='%s'", key, value)) } return args diff --git a/restic_test.go b/restic_test.go index c173ffe..2adeb42 100644 --- a/restic_test.go +++ b/restic_test.go @@ -50,7 +50,7 @@ func TestGlobalOptions(t *testing.T) { "--cleanup-cache", "--no-cache", "--no-lock", - "--option key='a long value'", + "--option", "key='a long value'", } AssertEqual(t, "args didn't match", expected, args) @@ -213,6 +213,9 @@ func TestResticInterface(t *testing.T) { // nolint:exhaustivestruct GlobalOpts: &main.ResticGlobalOpts{ CacheDir: cacheDir, + Options: map[string]string{ + "s3.storage-class": "REDUCED_REDUNDANCY", + }, }, Cwd: dataDir, }