backend/sftp: Add sftp.args option

Allow setting custom arguments for the `sftp` backend, by using the
`sftp.args` option. This is similar to the approach already implemented
in the `rclone` backend, to support new arguments without requiring
future code changes for each different SSH argument.

Closes #4241
This commit is contained in:
Michael Manganiello 2023-10-17 22:21:06 -03:00 committed by Michael Eischer
parent 17f2301cc2
commit 41f70f1f4f
5 changed files with 45 additions and 8 deletions

View file

@ -30,6 +30,11 @@ var sshcmdTests = []struct {
"ssh",
[]string{"host", "-p", "10022", "-l", "user", "-s", "sftp"},
},
{
Config{User: "user", Host: "host", Port: "10022", Path: "/dir/subdir", Args: "-i /path/to/id_rsa"},
"ssh",
[]string{"host", "-p", "10022", "-l", "user", "-i", "/path/to/id_rsa", "-s", "sftp"},
},
{
// IPv6 address.
Config{User: "user", Host: "::1", Path: "dir"},