sudoedit: New completion.

This commit is contained in:
Igor Murzov 2011-12-29 04:46:00 +04:00
parent 6621f37c5d
commit d0a14954ab
3 changed files with 10 additions and 1 deletions

View File

@ -151,6 +151,7 @@ smbtree
sparc-koji
spovray
stream
sudoedit
tightvncviewer
tracepath6
typeset

View File

@ -498,6 +498,7 @@ CLEANFILES = \
sparc-koji \
spovray \
stream \
sudoedit \
tightvncviewer \
tracepath6 \
typeset \
@ -770,6 +771,10 @@ symlinks:
rm -f $(targetdir)/$$file && \
$(LN_S) ssh $(targetdir)/$$file ; \
done
for file in sudoedit ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) sudo $(targetdir)/$$file ; \
done
for file in tracepath6 ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) tracepath $(targetdir)/$$file ; \

View File

@ -6,6 +6,9 @@ _sudo()
_init_completion || return
local i mode=normal
[[ $1 == *sudoedit ]] && mode=edit
[[ $mode == normal ]] &&
for (( i=1; i <= COMP_CWORD; i++ )); do
if [[ ${COMP_WORDS[i]} != -* ]]; then
local PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
@ -43,6 +46,6 @@ _sudo()
if [[ $mode == edit ]]; then
_filedir
fi
} && complete -F _sudo sudo
} && complete -F _sudo sudo sudoedit
# ex: ts=4 sw=4 et filetype=sh