[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-302-gd8e22da

Ville Skyttä ville.skytta at iki.fi
Sun May 15 12:59:41 UTC 2011


The following commit has been merged in the master branch:
commit fa1fec713b377bf8e1dd79c47d38de6f7be22dc1
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sun May 15 15:34:23 2011 +0300

    ldap*: Use _parse_help, add basic test cases.

diff --git a/completions/openldap b/completions/openldap
index 77b7f24..9520a5e 100644
--- a/completions/openldap
+++ b/completions/openldap
@@ -50,9 +50,7 @@ _ldapsearch()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '-n -u -v -t -tt -T -F -A -C -L -LL \
-            -LLL -M -MM -S -d -f -x -D -W -w -y -H -h -p -b -s -a \
-            -P -e -E -l -z -O -I -Q -U -R -X -Y -Z -ZZ' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) )
     fi
 } &&
 complete -F _ldapsearch ldapsearch
@@ -82,13 +80,7 @@ _ldapaddmodify()
     esac
 
     if [[ "$cur" == -* ]]; then
-        local options
-        options='-c -S -n -v -M -MM -d -D -W -w -y -h -H -p -P -O -I \
-            -Q -U -R -x -X -Y -Z -ZZ -f'
-        if [[ ${words[0]} == ldapmodify ]]; then
-            options+=" -a"
-        fi
-        COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) )
     fi
 } &&
 complete -F _ldapaddmodify ldapadd ldapmodify
@@ -118,8 +110,7 @@ _ldapdelete()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '-n -v -c -M -MM -d -f -D -W -w -y \
-            -H -h -P -p -O -U -R -r -x -I -Q -X -Y -Z -ZZ' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) )
     fi
 } &&
 complete -F _ldapdelete ldapdelete
@@ -149,8 +140,7 @@ _ldapcompare()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '-n -v -z -M -MM -d -D -W -w -y \
-            -H -h -P -p -O -I -Q -U -R -x -X -Y -Z -ZZ' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) )
     fi
 } &&
 complete -F _ldapcompare ldapcompare
@@ -180,8 +170,7 @@ _ldapmodrdn()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '-r -s -n -v -c -M -MM -d -D -W -w \
-            -y -H -h -P -p -O -I -Q -U -R -x -X -Y -Z -ZZ -f' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -ZZ -MM' -- "$cur" ) )
     fi
 } &&
 complete -F _ldapmodrdn ldapmodrdn
@@ -211,8 +200,7 @@ _ldapwhoami()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '-n -v -z -d -D -W -w -y -H -h -p -P \
-            -O -I -Q -U -R -x -X -Y -Z -ZZ' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) )
     fi
 } &&
 complete -F _ldapwhoami ldapwhoami
@@ -238,8 +226,7 @@ _ldappasswd()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '-A -a -t -d -D -H -h -n -p -S -s -T \
-            -v -W -w -y -O -I -Q -U -R -x -X -Y -Z -ZZ' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) )
     fi
 } &&
 complete -F _ldappasswd ldappasswd
diff --git a/test/completion/ldapadd.exp b/test/completion/ldapadd.exp
new file mode 100644
index 0000000..2c74de7
--- /dev/null
+++ b/test/completion/ldapadd.exp
@@ -0,0 +1 @@
+assert_source_completions ldapadd
diff --git a/test/completion/ldapcompare.exp b/test/completion/ldapcompare.exp
new file mode 100644
index 0000000..bb1db4c
--- /dev/null
+++ b/test/completion/ldapcompare.exp
@@ -0,0 +1 @@
+assert_source_completions ldapcompare
diff --git a/test/completion/vgcfgrestore.exp b/test/completion/ldapdelete.exp
similarity index 94%
copy from test/completion/vgcfgrestore.exp
copy to test/completion/ldapdelete.exp
index 7531998..76027d9 100644
--- a/test/completion/vgcfgrestore.exp
+++ b/test/completion/ldapdelete.exp
@@ -1 +1 @@
-assert_source_completions vgcfgrestore
+assert_source_completions ldapdelete
diff --git a/test/completion/ldapmodrdn.exp b/test/completion/ldapmodrdn.exp
new file mode 100644
index 0000000..9614af6
--- /dev/null
+++ b/test/completion/ldapmodrdn.exp
@@ -0,0 +1 @@
+assert_source_completions ldapmodrdn
diff --git a/test/completion/ldappasswd.exp b/test/completion/ldappasswd.exp
new file mode 100644
index 0000000..0a5ac72
--- /dev/null
+++ b/test/completion/ldappasswd.exp
@@ -0,0 +1 @@
+assert_source_completions ldappasswd
diff --git a/test/completion/ldapsearch.exp b/test/completion/ldapsearch.exp
new file mode 100644
index 0000000..c552967
--- /dev/null
+++ b/test/completion/ldapsearch.exp
@@ -0,0 +1 @@
+assert_source_completions ldapsearch
diff --git a/test/completion/ldapwhoami.exp b/test/completion/ldapwhoami.exp
new file mode 100644
index 0000000..9d07d8a
--- /dev/null
+++ b/test/completion/ldapwhoami.exp
@@ -0,0 +1 @@
+assert_source_completions ldapwhoami
diff --git a/test/lib/completions/a2ps.exp b/test/lib/completions/ldapadd.exp
similarity index 78%
copy from test/lib/completions/a2ps.exp
copy to test/lib/completions/ldapadd.exp
index 77cd07f..bc066ab 100644
--- a/test/lib/completions/a2ps.exp
+++ b/test/lib/completions/ldapadd.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "a2ps "
+assert_complete_any "ldapadd -"
 
 
 sync_after_int
diff --git a/test/lib/completions/aclocal.exp b/test/lib/completions/ldapcompare.exp
similarity index 76%
copy from test/lib/completions/aclocal.exp
copy to test/lib/completions/ldapcompare.exp
index da133aa..c693f70 100644
--- a/test/lib/completions/aclocal.exp
+++ b/test/lib/completions/ldapcompare.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "aclocal "
+assert_complete_any "ldapcompare -"
 
 
 sync_after_int
diff --git a/test/lib/completions/aclocal.exp b/test/lib/completions/ldapdelete.exp
similarity index 77%
copy from test/lib/completions/aclocal.exp
copy to test/lib/completions/ldapdelete.exp
index da133aa..cc20d0e 100644
--- a/test/lib/completions/aclocal.exp
+++ b/test/lib/completions/ldapdelete.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "aclocal "
+assert_complete_any "ldapdelete -"
 
 
 sync_after_int
diff --git a/test/lib/completions/aclocal.exp b/test/lib/completions/ldapmodrdn.exp
similarity index 77%
copy from test/lib/completions/aclocal.exp
copy to test/lib/completions/ldapmodrdn.exp
index da133aa..3ae6c39 100644
--- a/test/lib/completions/aclocal.exp
+++ b/test/lib/completions/ldapmodrdn.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "aclocal "
+assert_complete_any "ldapmodrdn -"
 
 
 sync_after_int
diff --git a/test/lib/completions/aclocal.exp b/test/lib/completions/ldappasswd.exp
similarity index 77%
copy from test/lib/completions/aclocal.exp
copy to test/lib/completions/ldappasswd.exp
index da133aa..2dd4939 100644
--- a/test/lib/completions/aclocal.exp
+++ b/test/lib/completions/ldappasswd.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "aclocal "
+assert_complete_any "ldappasswd -"
 
 
 sync_after_int
diff --git a/test/lib/completions/aclocal.exp b/test/lib/completions/ldapsearch.exp
similarity index 77%
copy from test/lib/completions/aclocal.exp
copy to test/lib/completions/ldapsearch.exp
index da133aa..92394ec 100644
--- a/test/lib/completions/aclocal.exp
+++ b/test/lib/completions/ldapsearch.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "aclocal "
+assert_complete_any "ldapsearch -"
 
 
 sync_after_int
diff --git a/test/lib/completions/aclocal.exp b/test/lib/completions/ldapwhoami.exp
similarity index 77%
copy from test/lib/completions/aclocal.exp
copy to test/lib/completions/ldapwhoami.exp
index da133aa..7be4174 100644
--- a/test/lib/completions/aclocal.exp
+++ b/test/lib/completions/ldapwhoami.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "aclocal "
+assert_complete_any "ldapwhoami -"
 
 
 sync_after_int

-- 
bash-completion



More information about the Bash-completion-commits mailing list