87d3ed9187
Even though filesystem notifications aren't implemented for FUSE, I decided to try my hand at implementing the autounmount feature (#128). I based it on the EncFS autounmount code, which records filesystem accesses and checks every X seconds whether it's idled long enough to unmount. I've tested the feature locally, but I haven't added any tests for this flag. I also haven't worked with Go before. So please let me know if there's anything that should be done differently. One particular concern: I worked from the assumption that the open files table is unique per-filesystem. If that's not true, I'll need to add an open file count and associated lock to the Filesystem type instead. https://github.com/rfjakob/gocryptfs/pull/265
56 lines
1.9 KiB
Go
56 lines
1.9 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/rfjakob/gocryptfs/internal/tlog"
|
|
)
|
|
|
|
const tUsage = "" +
|
|
"Usage: " + tlog.ProgramName + " -init|-passwd|-info [OPTIONS] CIPHERDIR\n" +
|
|
" or " + tlog.ProgramName + " [OPTIONS] CIPHERDIR MOUNTPOINT\n"
|
|
|
|
// helpShort is what gets displayed when passed "-h" or on syntax error.
|
|
func helpShort() {
|
|
printVersion()
|
|
fmt.Printf("\n")
|
|
fmt.Printf(tUsage)
|
|
fmt.Printf(`
|
|
Common Options (use -hh to show all):
|
|
-aessiv Use AES-SIV encryption (with -init)
|
|
-allow_other Allow other users to access the mount
|
|
-i, -idle Unmount automatically after specified idle duration
|
|
-config Custom path to config file
|
|
-ctlsock Create control socket at location
|
|
-extpass Call external program to prompt for the password
|
|
-fg Stay in the foreground
|
|
-fusedebug Debug FUSE calls
|
|
-h, -help This short help text
|
|
-hh Long help text with all options
|
|
-init Initialize encrypted directory
|
|
-info Display information about encrypted directory
|
|
-masterkey Mount with explicit master key instead of password
|
|
-nonempty Allow mounting over non-empty directory
|
|
-nosyslog Do not redirect log messages to syslog
|
|
-passfile Read password from file
|
|
-passwd Change password
|
|
-plaintextnames Do not encrypt file names (with -init)
|
|
-q, -quiet Silence informational messages
|
|
-reverse Enable reverse mode
|
|
-ro Mount read-only
|
|
-speed Run crypto speed test
|
|
-version Print version information
|
|
-- Stop option parsing
|
|
`)
|
|
}
|
|
|
|
// helpLong gets only displayed on "-hh"
|
|
func helpLong() {
|
|
printVersion()
|
|
fmt.Printf("\n")
|
|
fmt.Printf(tUsage)
|
|
fmt.Printf("\nOptions:\n")
|
|
flagSet.PrintDefaults()
|
|
fmt.Printf(" --\n Stop option parsing\n")
|
|
}
|