14 lines
218 B
Nix
14 lines
218 B
Nix
{ jq, writeDashBin }:
|
|
|
|
# usage: quote [ARGS...]
|
|
writeDashBin "quote" ''
|
|
set -efu
|
|
prefix=
|
|
for x; do
|
|
y=$(${jq}/bin/jq -nr --arg x "$x" '$x | @sh "\(.)"')
|
|
echo -n "$prefix$y"
|
|
prefix=' '
|
|
done
|
|
echo
|
|
''
|