summaryrefslogtreecommitdiff
path: root/ale_linters/sh/shell.vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2016-10-09 19:41:27 +0100
committerw0rp <devw0rp@gmail.com>2016-10-09 19:41:27 +0100
commit2d32c312059e10da03e8f0b9627b2f9ee49bd6bf (patch)
tree6028bc2f4a2f4fa66dcc6e8fc21d19ad907eecc7 /ale_linters/sh/shell.vim
parent9d52d968db9b6cfdc493e1418348a3ff26177230 (diff)
downloadale-2d32c312059e10da03e8f0b9627b2f9ee49bd6bf.zip
Handle arguments to shells in shebang lines too.
Diffstat (limited to 'ale_linters/sh/shell.vim')
-rw-r--r--ale_linters/sh/shell.vim5
1 files changed, 4 insertions, 1 deletions
diff --git a/ale_linters/sh/shell.vim b/ale_linters/sh/shell.vim
index ce8aa6c8..979bda3f 100644
--- a/ale_linters/sh/shell.vim
+++ b/ale_linters/sh/shell.vim
@@ -18,8 +18,11 @@ function! ale_linters#sh#shell#GetExecutable(buffer)
" Take the shell executable from the hashbang, if we can.
if len(banglines) == 1 && banglines[0] =~# '^#!'
+ " Remove options like -e, etc.
+ let line = substitute(banglines[0], '--\?[a-zA-Z0-9]\+', '', 'g')
+
for possible_shell in ['bash', 'tcsh', 'csh', 'zsh', 'sh']
- if banglines[0] =~# possible_shell . '\s*$'
+ if line =~# possible_shell . '\s*$'
return possible_shell
endif
endfor