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 sparc-koji
spovray spovray
stream stream
sudoedit
tightvncviewer tightvncviewer
tracepath6 tracepath6
typeset typeset

View File

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

View File

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