diff options
author | Jakob Unterwurzacher | 2017-05-30 19:01:32 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2017-05-30 19:01:32 +0200 |
commit | 1e598e96fcd2ef53ab2ee1e2b408e4ebe920e59b (patch) | |
tree | 6dd5bcae81e54b4935ecda0817518eca0ee45ebc /main.go | |
parent | ca5f469ea334bc5e93e25dae11140887d77b9673 (diff) |
main: add "-info" option
Pretty-prints the config while stripping out sensitive
(and uninteresting) data
https://github.com/rfjakob/gocryptfs/issues/111
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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 { |