Fix option adding
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
IamTheFij 2022-11-03 16:43:17 -07:00
parent 5813fe56bf
commit 917438471e
2 changed files with 5 additions and 2 deletions

View File

@ -213,7 +213,7 @@ func (glo ResticGlobalOpts) ToArgs() (args []string) {
args = maybeAddArgBool(args, "--no-lock", glo.NoLock) args = maybeAddArgBool(args, "--no-lock", glo.NoLock)
for key, value := range glo.Options { 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 return args

View File

@ -50,7 +50,7 @@ func TestGlobalOptions(t *testing.T) {
"--cleanup-cache", "--cleanup-cache",
"--no-cache", "--no-cache",
"--no-lock", "--no-lock",
"--option key='a long value'", "--option", "key='a long value'",
} }
AssertEqual(t, "args didn't match", expected, args) AssertEqual(t, "args didn't match", expected, args)
@ -213,6 +213,9 @@ func TestResticInterface(t *testing.T) {
// nolint:exhaustivestruct // nolint:exhaustivestruct
GlobalOpts: &main.ResticGlobalOpts{ GlobalOpts: &main.ResticGlobalOpts{
CacheDir: cacheDir, CacheDir: cacheDir,
Options: map[string]string{
"s3.storage-class": "REDUCED_REDUNDANCY",
},
}, },
Cwd: dataDir, Cwd: dataDir,
} }