# 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 { var 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 { var 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 { var 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 { var 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 { var 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 { var 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 { var 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