Skip to content

Commit

Permalink
pylint: Invoke python3 to search for modules if command contains 3
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Oct 4, 2017
1 parent fee4f3d commit d63b33d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions completions/pylint
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ _pylint()
local cur prev words cword split
_init_completion -s || return

local python=python; [[ $1 == *3* ]] && python=python3

case $prev in
--version|-h|--help|--long-help|--help-msg|--init-hook|--ignore|-e|\
--enable|-d|--disable|--evaluation|--max-line-length|\
Expand Down Expand Up @@ -34,7 +36,7 @@ _pylint()
--load-plugins|--deprecated-modules)
local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*},"
cur="${cur##*,}"
_xfunc python _python_modules
_xfunc python _python_modules $python
COMPREPLY=( ${COMPREPLY[@]/#/$prefix} )
return
;;
Expand All @@ -58,7 +60,7 @@ _pylint()
return
fi

_xfunc python _python_modules
_xfunc python _python_modules $python
_filedir py
} &&
complete -F _pylint pylint pylint-2 pylint-3
Expand Down

0 comments on commit d63b33d

Please sign in to comment.