hostname: New completion
This commit is contained in:
parent
b74d53761a
commit
c924d32b4c
@ -129,6 +129,7 @@ bashcomp_DATA = 2to3 \
|
|||||||
hddtemp \
|
hddtemp \
|
||||||
_hexdump \
|
_hexdump \
|
||||||
hid2hci \
|
hid2hci \
|
||||||
|
hostname \
|
||||||
hping2 \
|
hping2 \
|
||||||
htop \
|
htop \
|
||||||
htpasswd \
|
htpasswd \
|
||||||
|
23
completions/hostname
Normal file
23
completions/hostname
Normal file
@ -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
|
1
test/completion/hostname.exp
Normal file
1
test/completion/hostname.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions hostname
|
18
test/lib/completions/hostname.exp
Normal file
18
test/lib/completions/hostname.exp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "hostname -"
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user