pydoc: New completion.
parent
06002d04c7
commit
5c8a002008
|
@ -124,6 +124,7 @@ pvremove
|
|||
pvs
|
||||
pvscan
|
||||
pxz
|
||||
pydoc3
|
||||
python2
|
||||
python3
|
||||
quotacheck
|
||||
|
|
|
@ -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 ; \
|
||||
|
|
|
@ -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
|
|
@ -0,0 +1 @@
|
|||
assert_source_completions pydoc
|
|
@ -0,0 +1,18 @@
|
|||
proc setup {} {
|
||||
save_env
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "pydoc "
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Loading…
Reference in New Issue