hostname: New completion
parent
b74d53761a
commit
c924d32b4c
|
@ -129,6 +129,7 @@ bashcomp_DATA = 2to3 \
|
|||
hddtemp \
|
||||
_hexdump \
|
||||
hid2hci \
|
||||
hostname \
|
||||
hping2 \
|
||||
htop \
|
||||
htpasswd \
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
# hostname(1) completion -*- shell-script -*-
|
||||
|
||||
_hostname()
|
||||
{
|
||||
local cur prev words cword
|
||||
_init_completion || return
|
||||
|
||||
case $prev in
|
||||
-h|--help|-V|--version)
|
||||
return
|
||||
;;
|
||||
-F|--file)
|
||||
_filedir
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
[[ $cur == -* ]] && \
|
||||
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
|
||||
} &&
|
||||
complete -F _hostname hostname
|
||||
|
||||
# ex: ts=4 sw=4 et filetype=sh
|
|
@ -0,0 +1 @@
|
|||
assert_source_completions hostname
|
|
@ -0,0 +1,18 @@
|
|||
proc setup {} {
|
||||
save_env
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "hostname -"
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Loading…
Reference in New Issue