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.
This commit is contained in:
parent
495479dc66
commit
17df345103
|
@ -66,6 +66,9 @@ func initDir(args *argContainer) {
|
||||||
// keep the absolute path.
|
// keep the absolute path.
|
||||||
friendlyPath = args.cipherdir
|
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.Info.Printf(tlog.ColorGrey+"You can now mount it using: %s%s %s MOUNTPOINT"+tlog.ColorReset,
|
||||||
tlog.ProgramName, mountArgs, friendlyPath)
|
tlog.ProgramName, mountArgs, friendlyPath)
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
|
Loading…
Reference in New Issue