233 lines
4.4 KiB
Plaintext
Raw Normal View History

# bash completion for openldap -*- shell-script -*-
2009-05-18 23:03:37 +02:00
_ldap_uris()
{
2009-10-04 19:42:50 +02:00
COMPREPLY=( $( compgen -W 'ldap:// ldaps://' -- "$cur" ) )
2009-05-18 23:03:37 +02:00
}
_ldap_protocols()
{
2009-10-04 19:42:50 +02:00
COMPREPLY=( $( compgen -W '2 3' -- "$cur" ) )
2009-05-18 23:03:37 +02:00
}
_ldapsearch()
{
local cur prev words cword
_init_completion || return
2009-05-18 23:03:37 +02:00
case $prev in
2009-10-04 19:42:50 +02:00
-h)
_known_hosts_real "$cur"
return 0
;;
-H)
_ldap_uris
return 0
;;
-T)
_filedir -d
return 0
;;
-f|-y)
2009-10-04 19:42:50 +02:00
_filedir
return 0
;;
-s)
COMPREPLY=( $( compgen -W 'base one sub children' -- "$cur" ) )
return 0
;;
-a)
COMPREPLY=( $( compgen -W 'never always search find' \
-- "$cur" ) )
return 0
;;
-P)
_ldap_protocols
return 0
;;
esac
2009-05-18 23:03:37 +02:00
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
fi
2011-04-04 22:14:39 +03:00
} &&
2009-05-18 23:03:37 +02:00
complete -F _ldapsearch ldapsearch
_ldapaddmodify()
{
local cur prev words cword
_init_completion || return
2009-05-18 23:03:37 +02:00
case $prev in
2009-10-04 19:42:50 +02:00
-h)
_known_hosts_real "$cur"
return 0
;;
-H)
_ldap_uris
return 0
;;
-S|-f|-y)
2009-10-04 19:42:50 +02:00
_filedir
return 0
;;
-P)
_ldap_protocols
return 0
;;
esac
2009-05-18 23:03:37 +02:00
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
fi
2011-04-04 22:14:39 +03:00
} &&
2009-05-18 23:03:37 +02:00
complete -F _ldapaddmodify ldapadd ldapmodify
_ldapdelete()
{
local cur prev words cword
_init_completion || return
2009-05-18 23:03:37 +02:00
case $prev in
2009-10-04 19:42:50 +02:00
-h)
_known_hosts_real "$cur"
return 0
;;
-H)
_ldap_uris
return 0
;;
-f|-y)
2009-10-04 19:42:50 +02:00
_filedir
return 0
;;
-P)
_ldap_protocols
return 0
;;
esac
2009-05-18 23:03:37 +02:00
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
fi
2011-04-04 22:14:39 +03:00
} &&
2009-05-18 23:03:37 +02:00
complete -F _ldapdelete ldapdelete
_ldapcompare()
{
local cur prev words cword
_init_completion || return
2009-05-18 23:03:37 +02:00
case $prev in
2009-10-04 19:42:50 +02:00
-h)
_known_hosts_real "$cur"
return 0
;;
-H)
_ldap_uris
return 0
;;
-y)
_filedir
return 0
;;
-P)
_ldap_protocols
return 0
;;
esac
2009-05-18 23:03:37 +02:00
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
fi
2011-04-04 22:14:39 +03:00
} &&
2009-05-18 23:03:37 +02:00
complete -F _ldapcompare ldapcompare
_ldapmodrdn()
{
local cur prev words cword
_init_completion || return
2009-05-18 23:03:37 +02:00
case $prev in
2009-10-04 19:42:50 +02:00
-h)
_known_hosts_real "$cur"
return 0
;;
-H)
_ldap_uris
return 0
;;
-f|-y)
2009-10-04 19:42:50 +02:00
_filedir
return 0
;;
-P)
_ldap_protocols
return 0
;;
esac
2009-05-18 23:03:37 +02:00
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -ZZ -MM' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
fi
2011-04-04 22:14:39 +03:00
} &&
2009-05-18 23:03:37 +02:00
complete -F _ldapmodrdn ldapmodrdn
_ldapwhoami()
{
local cur prev words cword
_init_completion || return
2009-05-18 23:03:37 +02:00
case $prev in
2009-10-04 19:42:50 +02:00
-h)
_known_hosts_real "$cur"
return 0
;;
-H)
_ldap_uris
return 0
;;
-f|-y)
2009-10-04 19:42:50 +02:00
_filedir
return 0
;;
-P)
_ldap_protocols
return 0
;;
esac
2009-05-18 23:03:37 +02:00
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
fi
2011-04-04 22:14:39 +03:00
} &&
2009-05-18 23:03:37 +02:00
complete -F _ldapwhoami ldapwhoami
_ldappasswd()
{
local cur prev words cword
_init_completion || return
2009-05-18 23:03:37 +02:00
case $prev in
2009-10-04 19:42:50 +02:00
-h)
_known_hosts_real "$cur"
return 0
;;
-H)
_ldap_uris
return 0
;;
-t|-T|-y)
2009-10-04 19:42:50 +02:00
_filedir
return 0
;;
esac
2009-05-18 23:03:37 +02:00
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
fi
2011-04-04 22:14:39 +03:00
} &&
2009-05-18 23:03:37 +02:00
complete -F _ldappasswd ldappasswd
2009-10-04 19:42:50 +02:00
# ex: ts=4 sw=4 et filetype=sh