From 763facfd78784103dfe617690b38e2b9df5ac6e8 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 10 May 2017 09:13:46 +0100 Subject: [PATCH] cmount: implement --fuse-flag to pass commands to fuse library directly Useful for `--fuse-flag -h` to see exactly which options the library supports. --- cmd/cmount/mount.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/cmount/mount.go b/cmd/cmount/mount.go index 47ede1316..dad348100 100644 --- a/cmd/cmount/mount.go +++ b/cmd/cmount/mount.go @@ -47,6 +47,7 @@ var ( dirPerms = os.FileMode(0777) filePerms = os.FileMode(0666) extraOptions *[]string + extraFlags *[]string ) func init() { @@ -66,6 +67,7 @@ func init() { commandDefintion.Flags().VarP(&maxReadAhead, "max-read-ahead", "", "The number of bytes that can be prefetched for sequential reads.") commandDefintion.Flags().IntVarP(&umask, "umask", "", umask, "Override the permission bits set by the filesystem.") extraOptions = commandDefintion.Flags().StringArrayP("option", "o", []string{}, "Option for libfuse/WinFsp. Repeat if required.") + extraFlags = commandDefintion.Flags().StringArrayP("fuse-flag", "", []string{}, "Flags or arguments to be passed direct to libfuse/WinFsp. Repeat if required.") //commandDefintion.Flags().BoolVarP(&foreground, "foreground", "", foreground, "Do not detach.") } @@ -209,6 +211,9 @@ func mountOptions(device string, mountpoint string) (options []string) { for _, option := range *extraOptions { options = append(options, "-o", option) } + for _, option := range *extraFlags { + options = append(options, option) + } return options }