pydoc: New completion.

master
Ville Skyttä 2013-02-02 09:58:59 +02:00
parent 06002d04c7
commit 5c8a002008
5 changed files with 57 additions and 0 deletions

View File

@ -124,6 +124,7 @@ pvremove
pvs
pvscan
pxz
pydoc3
python2
python3
quotacheck

View File

@ -265,6 +265,7 @@ bashcomp_DATA = a2x \
pwd \
pwdx \
pwgen \
pydoc \
python \
qdbus \
qemu \
@ -499,6 +500,7 @@ CLEANFILES = \
pvs \
pvscan \
pxz \
pydoc3 \
python2 \
python3 \
quotacheck \
@ -776,6 +778,10 @@ symlinks: $(targetdir) $(DATA)
rm -f $(targetdir)/$$file && \
$(LN_S) puppet $(targetdir)/$$file ; \
done
for file in pydoc3 ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) pydoc $(targetdir)/$$file ; \
done
for file in python2 python3 ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) python $(targetdir)/$$file ; \

31
completions/pydoc Normal file
View File

@ -0,0 +1,31 @@
# pydoc completion -*- shell-script -*-
_pydoc()
{
local cur prev words cword
_init_completion || return
case $prev in
-k|-p)
return
;;
-w)
_filedir
return
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W \
'$( "$1" | sed -e "s/^pydoc3\{0,1\} //" | _parse_help - )' \
-- "$cur" ) )
return
fi
COMPREPLY=( $( compgen -W 'keywords topics modules' -- "$cur" ) )
_filedir py
# TODO: more completions: modules, ...
} &&
complete -F _pydoc pydoc pydoc3
# ex: ts=4 sw=4 et filetype=sh

View File

@ -0,0 +1 @@
assert_source_completions pydoc

View File

@ -0,0 +1,18 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "pydoc "
sync_after_int
teardown