From 17df345103f53c9076fe1311ae459af1c4e7c82a Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 9 Oct 2016 18:27:03 +0200 Subject: main: init: handle spaces in mount suggestion message Before: You can now mount it using: gocryptfs a x MOUNTPOINT After: You can now mount it using: gocryptfs "a x" MOUNTPOINT This is still not bulletproof but should handle the common case of having a space in the directory name. After all, it's only a suggestion. --- init_dir.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init_dir.go b/init_dir.go index 1f91e7b..c12a8dc 100644 --- a/init_dir.go +++ b/init_dir.go @@ -66,6 +66,9 @@ func initDir(args *argContainer) { // keep the absolute path. friendlyPath = args.cipherdir } + if strings.Contains(friendlyPath, " ") { + friendlyPath = "\"" + friendlyPath + "\"" + } tlog.Info.Printf(tlog.ColorGrey+"You can now mount it using: %s%s %s MOUNTPOINT"+tlog.ColorReset, tlog.ProgramName, mountArgs, friendlyPath) os.Exit(0) -- cgit v1.2.3