From a9895b34872d2299cfe424444fab15516e7f96c9 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 10 May 2020 00:04:14 +0200 Subject: gocryptfs-xray: add -0 flag, add tests The -0 flags works like xargs -0. --- gocryptfs-xray/xray_main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gocryptfs-xray/xray_main.go') diff --git a/gocryptfs-xray/xray_main.go b/gocryptfs-xray/xray_main.go index 0777524..8dcaf8d 100644 --- a/gocryptfs-xray/xray_main.go +++ b/gocryptfs-xray/xray_main.go @@ -65,10 +65,12 @@ func main() { decryptPaths *bool encryptPaths *bool aessiv *bool + sep0 *bool } args.dumpmasterkey = flag.Bool("dumpmasterkey", false, "Decrypt and dump the master key") args.decryptPaths = flag.Bool("decrypt-paths", false, "Decrypt file paths using gocryptfs control socket") args.encryptPaths = flag.Bool("encrypt-paths", false, "Encrypt file paths using gocryptfs control socket") + args.sep0 = flag.Bool("0", false, "Use \\0 instead of \\n as separator") args.aessiv = flag.Bool("aessiv", false, "Assume AES-SIV mode instead of AES-GCM") flag.Usage = usage flag.Parse() @@ -83,10 +85,10 @@ func main() { } fn := flag.Arg(0) if *args.decryptPaths { - decryptPaths(fn) + decryptPaths(fn, *args.sep0) } if *args.encryptPaths { - encryptPaths(fn) + encryptPaths(fn, *args.sep0) } fd, err := os.Open(fn) if err != nil { -- cgit v1.2.3