// Show stats if the user has specifically requested them
ifcmd.ShowStats(){
stopStats:=cmd.StartStats()
deferclose(stopStats)
}
err:=Mount(fdst,args[1])
iferr!=nil{
log.Fatalf("Fatal error: %v",err)
}
},
}
// Register the command
cmd.Root.AddCommand(commandDefintion)
// Add flags
flags:=commandDefintion.Flags()
flags.BoolVarP(&DebugFUSE,"debug-fuse","",DebugFUSE,"Debug the FUSE internals - needs -v.")
// mount options
flags.BoolVarP(&AllowNonEmpty,"allow-non-empty","",AllowNonEmpty,"Allow mounting over a non-empty directory.")
flags.BoolVarP(&AllowRoot,"allow-root","",AllowRoot,"Allow access to root user.")
flags.BoolVarP(&AllowOther,"allow-other","",AllowOther,"Allow access to other users.")
flags.BoolVarP(&DefaultPermissions,"default-permissions","",DefaultPermissions,"Makes kernel enforce access control based on the file mode.")
flags.BoolVarP(&WritebackCache,"write-back-cache","",WritebackCache,"Makes kernel buffer writes before sending them to rclone. Without this, writethrough caching is used.")
flags.VarP(&MaxReadAhead,"max-read-ahead","","The number of bytes that can be prefetched for sequential reads.")
ExtraOptions=flags.StringArrayP("option","o",[]string{},"Option for libfuse/WinFsp. Repeat if required.")
ExtraFlags=flags.StringArrayP("fuse-flag","",[]string{},"Flags or arguments to be passed direct to libfuse/WinFsp. Repeat if required.")
//flags.BoolVarP(&foreground, "foreground", "", foreground, "Do not detach.")
// AddFlags adds the non filing system specific flags to the command
funcAddFlags(flags*pflag.FlagSet){
flags.BoolVarP(&NoModTime,"no-modtime","",NoModTime,"Don't read/write the modification time (can speed things up).")
flags.BoolVarP(&NoChecksum,"no-checksum","",NoChecksum,"Don't compare checksums on up/download.")
flags.BoolVarP(&NoSeek,"no-seek","",NoSeek,"Don't allow seeking in files.")
flags.DurationVarP(&DirCacheTime,"dir-cache-time","",DirCacheTime,"Time to cache directory entries for.")
flags.DurationVarP(&PollInterval,"poll-interval","",PollInterval,"Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable.")