# hostinfo completion _hostinfo_hosts="$(for file in /usr/local/share/hostinfo/* ; do basename $file | sed 's/.spline.inf.fu-berlin.de//' ; done)" _hostinfo() { local cur prev COMPREPLY=() _get_comp_words_by_ref cur prev _get_first_arg if [[ -z "$arg" ]]; then _completion="$_hostinfo_hosts" else _completion="hostname os arch addresses ports vserver vserver-host" fi COMPREPLY=( $( compgen -W "-o --oneline $_completion" -- $cur ) ) } complete -F _hostinfo hostinfo