rclone.mount: ignore _netdev mount argument - FIxes #5808

Do not trigger an error upon parsing argument starting with underscores.

_netdev was already ignored after parsing.
This commit is contained in:
Hugal31 2022-05-12 21:27:13 +02:00 committed by GitHub
parent 6500e1d205
commit a36fef8a66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -208,7 +208,7 @@ func parseHelperOptionString(optString string) (opts []string, err error) {
if len(param) == 0 {
return nil, errHelperEmptyOption
}
if param[0] == '-' || param[0] == '_' {
if param[0] == '-' {
return nil, errHelperOptionName
}
prev = i + 1

View File

@ -20,7 +20,7 @@ func TestMountHelperArgs(t *testing.T) {
src: []string{},
dst: []string{"mount", "--daemon"},
}, {
src: []string{"-o", `x-systemd.automount,vvv,env.HTTPS_PROXY="a b;c,d?EF",ro,rw,args2env`},
src: []string{"-o", `x-systemd.automount,vvv,env.HTTPS_PROXY="a b;c,d?EF",ro,rw,args2env,_netdev`},
dst: []string{"mount", "--read-only", "--verbose=3", "--daemon"},
env: "HTTPS_PROXY=a b;c,d?EF",
}}