Skip to content

Commit

Permalink
pydoc, pylint: Determine python2/3 based on command basename only
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Jun 23, 2018
1 parent 7e6a220 commit fa6ec59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion completions/pydoc
Expand Up @@ -25,7 +25,7 @@ _pydoc()
COMPREPLY=( $( compgen -W 'keywords topics modules' -- "$cur" ) )

if [[ $cur != @(.|*/)* ]]; then
local python=python; [[ $1 == *3* ]] && python=python3
local python=python; [[ ${1##*/} == *3* ]] && python=python3
_xfunc python _python_modules $python
fi

Expand Down
2 changes: 1 addition & 1 deletion completions/pylint
Expand Up @@ -5,7 +5,7 @@ _pylint()
local cur prev words cword split
_init_completion -s || return

local python=python; [[ $1 == *3* ]] && python=python3
local python=python; [[ ${1##*/} == *3* ]] && python=python3

case $prev in
--version|--help|--long-help|--help-msg|--init-hook|--ignore|--enable|\
Expand Down

0 comments on commit fa6ec59

Please sign in to comment.