summaryrefslogtreecommitdiff
path: root/help.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-05-30 17:59:13 +0200
committerJakob Unterwurzacher2017-05-30 17:59:13 +0200
commitdf2f4b1c40dec4a9996fd07cc7db1f2c82afbb7c (patch)
tree6d0ec1e3915f98a8318ffbfafa78cef9ece93b87 /help.go
parent9a217ce786581ee7ec18b27e46f0096763c85f9e (diff)
main: add short help text
We have accumulated so many options over time that they no longer fit on the screen. Display only a useful subset of options to the user unless they pass "-hh".
Diffstat (limited to 'help.go')
-rw-r--r--help.go53
1 files changed, 53 insertions, 0 deletions
diff --git a/help.go b/help.go
new file mode 100644
index 0000000..378c380
--- /dev/null
+++ b/help.go
@@ -0,0 +1,53 @@
+package main
+
+import (
+ "fmt"
+
+ "github.com/rfjakob/gocryptfs/internal/tlog"
+)
+
+const tUsage = "" +
+ "Usage: " + tlog.ProgramName + " -init|-passwd [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
+ -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
+ -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")
+}