# bash completion for openldap -*- shell-script -*- proc _ldap_uris { setglobal COMPREPLY = ''( $( compgen -W 'ldap:// ldaps://' -- "$cur" ) ) } proc _ldap_protocols { setglobal COMPREPLY = ''( $( compgen -W '2 3' -- "$cur" ) ) } proc _ldapsearch { local cur prev words cword _init_completion || return match $prev { with -h _known_hosts_real $cur return 0 with -H _ldap_uris return 0 with -T _filedir -d return 0 with -f|-y _filedir return 0 with -s setglobal COMPREPLY = ''( $( compgen -W 'base one sub children' -- "$cur" ) ) return 0 with -a setglobal COMPREPLY = ''( $( compgen -W 'never always search find' \ -- "$cur" ) ) return 0 with -P _ldap_protocols return 0 } if [[ "$cur" == -* ]] { setglobal COMPREPLY = ''( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) } } && complete -F _ldapsearch ldapsearch proc _ldapaddmodify { local cur prev words cword _init_completion || return match $prev { with -h _known_hosts_real $cur return 0 with -H _ldap_uris return 0 with -S|-f|-y _filedir return 0 with -P _ldap_protocols return 0 } if [[ "$cur" == -* ]] { setglobal COMPREPLY = ''( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) } } && complete -F _ldapaddmodify ldapadd ldapmodify proc _ldapdelete { local cur prev words cword _init_completion || return match $prev { with -h _known_hosts_real $cur return 0 with -H _ldap_uris return 0 with -f|-y _filedir return 0 with -P _ldap_protocols return 0 } if [[ "$cur" == -* ]] { setglobal COMPREPLY = ''( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) } } && complete -F _ldapdelete ldapdelete proc _ldapcompare { local cur prev words cword _init_completion || return match $prev { with -h _known_hosts_real $cur return 0 with -H _ldap_uris return 0 with -y _filedir return 0 with -P _ldap_protocols return 0 } if [[ "$cur" == -* ]] { setglobal COMPREPLY = ''( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) } } && complete -F _ldapcompare ldapcompare proc _ldapmodrdn { local cur prev words cword _init_completion || return match $prev { with -h _known_hosts_real $cur return 0 with -H _ldap_uris return 0 with -f|-y _filedir return 0 with -P _ldap_protocols return 0 } if [[ "$cur" == -* ]] { setglobal COMPREPLY = ''( $( compgen -W '$( _parse_help "$1" ) -ZZ -MM' -- "$cur" ) ) } } && complete -F _ldapmodrdn ldapmodrdn proc _ldapwhoami { local cur prev words cword _init_completion || return match $prev { with -h _known_hosts_real $cur return 0 with -H _ldap_uris return 0 with -f|-y _filedir return 0 with -P _ldap_protocols return 0 } if [[ "$cur" == -* ]] { setglobal COMPREPLY = ''( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) } } && complete -F _ldapwhoami ldapwhoami proc _ldappasswd { local cur prev words cword _init_completion || return match $prev { with -h _known_hosts_real $cur return 0 with -H _ldap_uris return 0 with -t|-T|-y _filedir return 0 } if [[ "$cur" == -* ]] { setglobal COMPREPLY = ''( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) } } && complete -F _ldappasswd ldappasswd # ex: ts=4 sw=4 et filetype=sh