# iwpriv completion -*- shell-script -*- proc _iwpriv { local cur prev words cword _init_completion || return match $prev { with roam setglobal COMPREPLY = ''( $( compgen -W 'on off' -- "$cur" ) ) return 0 with port setglobal COMPREPLY = ''( $( compgen -W 'ad-hoc managed' -- "$cur" ) ) return 0 } if [[ $cword -eq 1 ]] { if [[ "$cur" == -* ]] { setglobal COMPREPLY = ''( $( compgen -W '--help --version' -- "$cur" ) ) } else { _available_interfaces -w } } else { setglobal COMPREPLY = ''( $( compgen -W '--all roam port' -- "$cur" ) ) } } && complete -F _iwpriv iwpriv # ex: ts=4 sw=4 et filetype=sh