From 44f1065ada14dda97d3c0417b120207d460e0be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 2 Feb 2013 10:51:42 +0200 Subject: pydoc: Complete on keywords and topics. --- completions/pydoc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/completions/pydoc b/completions/pydoc index 16adb863..2783d174 100644 --- a/completions/pydoc +++ b/completions/pydoc @@ -23,8 +23,15 @@ _pydoc() fi COMPREPLY=( $( compgen -W 'keywords topics modules' -- "$cur" ) ) + local python=python; [[ $1 == *3* ]] && python=python3 _xfunc python _python_modules $python + + # Note that we don't do "pydoc modules" as it is known to hang on + # some systems; _python_modules tends to work better and faster. + COMPREPLY+=( $( compgen -W \ + '$( $1 keywords topics | sed -e /^Here/d )' -- "$cur" ) ) + _filedir py } && complete -F _pydoc pydoc pydoc3 -- cgit v1.2.1