summaryrefslogtreecommitdiff
path: root/main.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 /main.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 'main.go')
-rw-r--r--main.go22
1 files changed, 6 insertions, 16 deletions
diff --git a/main.go b/main.go
index 77d25f4..bc2ca12 100644
--- a/main.go
+++ b/main.go
@@ -31,21 +31,6 @@ var BuildTime = "0"
// raceDetector is set to true by race.go if we are compiled with "go build -race"
var raceDetector bool
-func usageText() {
- printVersion()
- fmt.Printf(`
-Usage: %s -init|-passwd [OPTIONS] CIPHERDIR
- or %s [OPTIONS] CIPHERDIR MOUNTPOINT [-o COMMA-SEPARATED-OPTIONS]
-
-Options:
-`, tlog.ProgramName, tlog.ProgramName)
-
- flagSet.PrintDefaults()
- fmt.Print(` --
- Stop option parsing
-`)
-}
-
// loadConfig loads the config file "args.config", prompting the user for the password
func loadConfig(args *argContainer) (masterkey []byte, confFile *configfile.ConfFile, err error) {
// Check if the file can be opened at all before prompting for a password
@@ -145,6 +130,11 @@ func main() {
printVersion()
os.Exit(0)
}
+ // "-hh"
+ if args.hh {
+ helpLong()
+ os.Exit(0)
+ }
// "-speed"
if args.speed {
speed.Run()
@@ -163,7 +153,7 @@ func main() {
os.Exit(exitcodes.CipherDir)
}
} else {
- usageText()
+ helpShort()
os.Exit(exitcodes.Usage)
}
// "-q"