Use eval ${kak_opt_(make|grep}cmd} in (make|grep).kak

Quotes in the variable are preserved that way.
This commit is contained in:
Maxime Coste 2013-11-08 19:05:30 +00:00
parent 414a1332eb
commit b4cc8edd35
2 changed files with 3 additions and 3 deletions

View File

@ -6,9 +6,9 @@ def -shell-params -file-completion \
output=$(mktemp -d -t kak-grep.XXXXXXXX)/fifo output=$(mktemp -d -t kak-grep.XXXXXXXX)/fifo
mkfifo ${output} mkfifo ${output}
if (( $# > 0 )); then if (( $# > 0 )); then
( ${kak_opt_grepcmd} "$@" | tr -d '\r' >& ${output} ) >& /dev/null < /dev/null & ( eval ${kak_opt_grepcmd} "$@" | tr -d '\r' >& ${output} ) >& /dev/null < /dev/null &
else else
( ${kak_opt_grepcmd} "${kak_selection}" | tr -d '\r' >& ${output} ) >& /dev/null < /dev/null & ( eval ${kak_opt_grepcmd} "${kak_selection}" | tr -d '\r' >& ${output} ) >& /dev/null < /dev/null &
fi fi
[[ -n "$kak_opt_toolsclient" ]] && echo "eval -client '$kak_opt_toolsclient' %{" [[ -n "$kak_opt_toolsclient" ]] && echo "eval -client '$kak_opt_toolsclient' %{"

View File

@ -4,7 +4,7 @@ decl str toolsclient
def -shell-params make %{ %sh{ def -shell-params make %{ %sh{
output=$(mktemp -d -t kak-make.XXXXXXXX)/fifo output=$(mktemp -d -t kak-make.XXXXXXXX)/fifo
mkfifo ${output} mkfifo ${output}
( ${kak_opt_makecmd} $@ >& ${output} ) >& /dev/null < /dev/null & ( eval ${kak_opt_makecmd} $@ >& ${output} ) >& /dev/null < /dev/null &
[[ -n "$kak_opt_toolsclient" ]] && echo "eval -client '$kak_opt_toolsclient' %{" [[ -n "$kak_opt_toolsclient" ]] && echo "eval -client '$kak_opt_toolsclient' %{"