diff options
author | Jakob Unterwurzacher | 2016-10-09 18:27:03 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-10-09 18:27:03 +0200 |
commit | 17df345103f53c9076fe1311ae459af1c4e7c82a (patch) | |
tree | 46f1a8a7d3989f29cee0a9bba6b1002cd17ce12a /init_dir.go | |
parent | 495479dc66efae688895aed8902d00f0350cdea7 (diff) |
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.
Diffstat (limited to 'init_dir.go')
-rw-r--r-- | init_dir.go | 3 |
1 files changed, 3 insertions, 0 deletions
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) |