Skip to content

Commit fa6ec59

Browse files
committed
pydoc, pylint: Determine python2/3 based on command basename only
1 parent 7e6a220 commit fa6ec59

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

completions/pydoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ _pydoc()
2525
COMPREPLY=( $( compgen -W 'keywords topics modules' -- "$cur" ) )
2626

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

completions/pylint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ _pylint()
55
local cur prev words cword split
66
_init_completion -s || return
77

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

1010
case $prev in
1111
--version|--help|--long-help|--help-msg|--init-hook|--ignore|--enable|\

0 commit comments

Comments
 (0)