From fa6ec59dfacdb7067575ad0c2d13b8494fbd4397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 23 Jun 2018 08:18:47 +0300 Subject: [PATCH] pydoc, pylint: Determine python2/3 based on command basename only --- completions/pydoc | 2 +- completions/pylint | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/pydoc b/completions/pydoc index 1597bf26021..727999f8574 100644 --- a/completions/pydoc +++ b/completions/pydoc @@ -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 diff --git a/completions/pylint b/completions/pylint index 51d2d431ed1..a55dcc93932 100644 --- a/completions/pylint +++ b/completions/pylint @@ -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|\