Skip to content

Commit 6f99da9

Browse files
committed
Add ability to pass arbitrary -o options to sshfs call
Signed-off-by: Yoriyasu Yano <[email protected]>
1 parent 95d96fa commit 6f99da9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmd/sshocker/run.go

+8
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ var (
4242
Usage: "enable sshfs nonempty",
4343
Value: false,
4444
},
45+
&cli.StringSliceFlag{
46+
Name: "sshfs-option",
47+
Usage: "Set sshfs mount options.",
48+
},
4549
&cli.StringFlag{
4650
Name: "driver",
4751
Usage: "SFTP server driver. \"builtin\" (legacy) or \"openssh-sftp-server\" (robust and secure, recommended), automatically chosen by default",
@@ -94,6 +98,10 @@ func runAction(clicontext *cli.Context) error {
9498
if clicontext.Bool("sshfs-nonempty") {
9599
sshfsAdditionalArgs = append(sshfsAdditionalArgs, "-o", "nonempty")
96100
}
101+
for _, o := range clicontext.StringSlice("sshfs-option") {
102+
sshfsAdditionalArgs = append(sshfsAdditionalArgs, "-o", o)
103+
}
104+
97105
x := &sshocker.Sshocker{
98106
SSHConfig: sshConfig,
99107
Host: host,

0 commit comments

Comments
 (0)