From: Nathaniel Wesley Filardo Date: Sat, 19 Feb 2022 10:14:49 +0000 (+0000) Subject: Use -- in generated shell commands X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=370c643fb121c9264bb0b086307f55da8467cec9;p=csdb Use -- in generated shell commands Deal with paths beginning with '-' --- 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'"