rc lint: Print an error when lintcmd is empty

This commit is contained in:
Frank LENORMAND 2018-07-18 14:16:05 +03:00
parent c58457a3c0
commit 4612d0928a

View File

@ -10,6 +10,11 @@ declare-option -hidden int lint_warning_count
define-command lint -docstring 'Parse the current buffer with a linter' %{
evaluate-commands %sh{
if [ -z "${kak_opt_lintcmd}" ]; then
printf %s\\n 'echo -markup {Error}The `lintcmd` option is not set'
exit 1
fi
dir=$(mktemp -d "${TMPDIR:-/tmp}"/kak-lint.XXXXXXXX)
mkfifo "$dir"/fifo
printf '%s\n' "evaluate-commands -no-hooks write -sync $dir/buf"