summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/main.go b/main.go
index bc2ca12..8dada52 100644
--- a/main.go
+++ b/main.go
@@ -214,7 +214,19 @@ func main() {
} else {
tlog.Debug.Printf("OpenSSL enabled")
}
- // Operation flags: -init or -passwd; otherwise: mount
+ // Operation flags
+ if args.info && args.init || args.info && args.passwd || args.passwd && args.init {
+ tlog.Fatal.Printf("At most one of -info, -init, -passwd is allowed")
+ os.Exit(exitcodes.Usage)
+ }
+ // "-info"
+ if args.info {
+ if flagSet.NArg() > 1 {
+ tlog.Fatal.Printf("Usage: %s -info CIPHERDIR", tlog.ProgramName)
+ os.Exit(exitcodes.Usage)
+ }
+ info(args.config) // does not return
+ }
// "-init"
if args.init {
if flagSet.NArg() > 1 {