stockholm/krebs/5pkgs/simple/quote.nix
2017-10-17 20:01:53 +02:00

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
''