From 370c643fb121c9264bb0b086307f55da8467cec9 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Sat, 19 Feb 2022 10:14:49 +0000 Subject: [PATCH] Use -- in generated shell commands Deal with paths beginning with '-' --- cdb | 2 +- test.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cdb b/cdb index df50eaf..6474daa 100755 --- a/cdb +++ b/cdb @@ -315,7 +315,7 @@ mksubcmd(function(c) " to ", human_escape(q), "\n") end io.write(args.move and "mv" or "cp", - " ", shell_escape(p), " ", shell_escape(q), eol) + " -- ", shell_escape(p), " ", shell_escape(q), eol) log_new_hash(h, q) elseif args.inplace then io.stderr:write("Adding in place ", human_escape(p), "\n") diff --git a/test.sh b/test.sh index 07e3edd..16f5758 100755 --- a/test.sh +++ b/test.sh @@ -158,8 +158,8 @@ ti'cky copy with \$extra HERE diff -u - <(${LUA} ./cdb --db ${DB1} ingest --move --target x --digest-log ${LOG2} <${LOG1}) <&1 <<<'9 rude'$'\r''copy') \ <<<"Import hash 9 from path 'rude'$'\\x0d''copy' already in database at 'twinned'" -- 2.50.1