hostname: New completion

master
Ville Skyttä 2014-05-03 23:13:33 +03:00
parent b74d53761a
commit c924d32b4c
4 changed files with 43 additions and 0 deletions

View File

@ -129,6 +129,7 @@ bashcomp_DATA = 2to3 \
hddtemp \
_hexdump \
hid2hci \
hostname \
hping2 \
htop \
htpasswd \

23
completions/hostname Normal file
View 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

View File

@ -0,0 +1 @@
assert_source_completions hostname

View File

@ -0,0 +1,18 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "hostname -"
sync_after_int
teardown