nutools/lib/completion.d/nutools

28 lines
943 B
Plaintext
Raw Normal View History

# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
function __nutools_host_completion() {
local cur prev; _get_comp_words_by_ref cur prev
[ "$prev" == "-h" -o "$prev" == "-H" -o "$prev" == "--host" ] && _known_hosts_real "$cur"
return 0
}
function __nutools_whost_completion() {
local cur prev; _get_comp_words_by_ref cur prev
if [ "$prev" == "-h" -o "$prev" == "-H" -o "$prev" == "--host" ]; then
_known_hosts_real "$cur"
elif [ "$prev" == "-w" -o "$prev" == "--whost" ]; then
_known_hosts_real "$cur"
fi
return 0
}
2017-04-18 11:35:54 +04:00
complete -F __nutools_host_completion -o default uinst ruinst runs rruns rwoinst rtoinst
complete -F __nutools_whost_completion -o default rwoinst
2015-03-28 01:18:35 +04:00
if __bash_completion_module_enabled ssh; then
shopt -u hostcomplete
complete -F _ssh ussh cssh mssh
fi
2017-01-10 16:37:41 +04:00
if __bash_completion_module_enabled umount; then
complete -F _umount -o dirnames umountr
fi