sudoedit: New completion.
This commit is contained in:
parent
6621f37c5d
commit
d0a14954ab
1
completions/.gitignore
vendored
1
completions/.gitignore
vendored
@ -151,6 +151,7 @@ smbtree
|
|||||||
sparc-koji
|
sparc-koji
|
||||||
spovray
|
spovray
|
||||||
stream
|
stream
|
||||||
|
sudoedit
|
||||||
tightvncviewer
|
tightvncviewer
|
||||||
tracepath6
|
tracepath6
|
||||||
typeset
|
typeset
|
||||||
|
@ -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 ; \
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user