[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 8f0055553bc15bb4aa31e6a32e0572949cffb6c3

Ville Skyttä ville.skytta at iki.fi
Fri Nov 12 19:56:52 UTC 2010


The following commit has been merged in the master branch:
commit 8f0055553bc15bb4aa31e6a32e0572949cffb6c3
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Fri Nov 12 21:56:40 2010 +0200

    Add/improve various autotools completions.

diff --git a/CHANGES b/CHANGES
index 47fdab5..c53ae2f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -36,6 +36,7 @@ bash-completion (2.x)
   * Improve relevance of many user/group completions, depending on context.
   * Remove most "-o filenames" options to "complete", turn "-o filenames" on
     dynamically when needed instead.
+  * Add/improve various autotools completions.
 
   [ Freddy Vulto ]
   * Added _tilde(), fix ~username completion (Alioth: #312613, Debian: #587095)
diff --git a/bash_completion b/bash_completion
index 0e94b4d..3247278 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1575,7 +1575,7 @@ _longopt()
     fi
 }
 # makeinfo and texi2dvi are defined elsewhere.
-for i in a2ps autoconf automake awk bash bc bison cat colordiff cp csplit \
+for i in a2ps awk bash bc bison cat colordiff cp csplit \
     curl cut date df diff dir du enscript env expand fmt fold gperf gprof \
     grep grub head indent irb ld ldd less ln ls m4 md5sum mkdir mkfifo mknod \
     mv netstat nl nm objcopy objdump od paste patch pr ptx readelf rm rmdir \
diff --git a/completions/Makefile.am b/completions/Makefile.am
index ead561b..2071564 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -6,6 +6,8 @@ bashcomp_DATA = abook \
 		apt-build \
 		aptitude \
 		aspell \
+		autoconf \
+		automake \
 		autorpm \
 		bash-builtins \
 		bind-utils \
diff --git a/completions/autoconf b/completions/autoconf
new file mode 100644
index 0000000..c8f1b19
--- /dev/null
+++ b/completions/autoconf
@@ -0,0 +1,124 @@
+# Completions for autoconf tools
+
+have autoconf &&
+_autoconf()
+{
+    COMPREPLY=()
+    local cur prev split=false
+    _get_comp_words_by_ref cur prev
+
+    _split_longopt && split=true
+
+    case "$prev" in
+        --help|-h|--version|-V|--trace|-t)
+            return 0
+            ;;
+        --output|-o)
+            _filedir
+            return 0
+            ;;
+        --warnings|-W)
+            local cats=( cross obsolete syntax )
+            COMPREPLY=( $( compgen -W \
+                '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) )
+            return 0
+            ;;
+        --prepend-include|-B|--include|-I)
+            _filedir -d
+            return 0
+            ;;
+    esac
+
+    $split && return 0
+
+    if [[ "$cur" == -* ]]; then
+        _longopt $1
+        return
+    fi
+
+    _filedir '@(ac|in)'
+} &&
+complete -F _autoconf autoconf
+
+have autoreconf || have autoheader &&
+_autoreconf()
+{
+    COMPREPLY=()
+    local cur prev split=false
+    _get_comp_words_by_ref cur prev
+
+    _split_longopt && split=true
+
+    case "$prev" in
+        --help|-h|--version|-V)
+            return 0
+            ;;
+        --warnings|-W)
+            local cats=( cross gnu obsolete override portability syntax \
+                unsupported )
+            COMPREPLY=( $( compgen -W \
+                '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) )
+            return 0
+            ;;
+        --prepend-include|-B|--include|-I)
+            _filedir -d
+            return 0
+            ;;
+    esac
+
+    $split && return 0
+
+    if [[ "$cur" == -* ]]; then
+        _longopt $1
+        return 0
+    fi
+
+    if [[ $1 == autoheader ]] ; then
+        _filedir '@(ac|in)'
+    else
+        _filedir -d
+    fi
+} &&
+complete -F _autoreconf autoreconf autoheader
+
+have autoscan || have autoupdate &&
+_autoscan()
+{
+    COMPREPLY=()
+    local cur prev split=false
+    _get_comp_words_by_ref cur prev
+
+    _split_longopt && split=true
+
+    case "$prev" in
+        --help|-h|--version|-V)
+            return 0
+            ;;
+        --prepend-include|-B|--include|-I)
+            _filedir -d
+            return 0
+            ;;
+    esac
+
+    $split && return 0
+
+    if [[ "$cur" == -* ]]; then
+        _longopt $1
+        return 0
+    fi
+
+    if [[ $1 == autoupdate ]] ; then
+        _filedir '@(ac|in)'
+    else
+        _filedir -d
+    fi
+} &&
+complete -F _autoscan autoscan autoupdate
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/automake b/completions/automake
new file mode 100644
index 0000000..7ed8745
--- /dev/null
+++ b/completions/automake
@@ -0,0 +1,80 @@
+# Completions for automake tools
+
+have automake &&
+_automake()
+{
+    COMPREPLY=()
+    local cur prev split=false
+    _get_comp_words_by_ref cur prev
+
+    _split_longopt && split=true
+
+    case "$prev" in
+        --help|--version)
+            return 0
+            ;;
+        --warnings|-W)
+            local cats=( gnu obsolete override portability syntax unsupported )
+            COMPREPLY=( $( compgen -W \
+                '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) )
+            return 0
+            ;;
+        --libdir)
+            _filedir -d
+            return 0
+            ;;
+    esac
+
+    $split && return 0
+
+    if [[ "$cur" == -* ]]; then
+        _longopt $1
+        return
+    fi
+
+    _filedir
+} &&
+complete -F _automake automake automake-1.11
+
+have aclocal &&
+_aclocal()
+{
+    COMPREPLY=()
+    local cur prev split=false
+    _get_comp_words_by_ref cur prev
+
+    _split_longopt && split=true
+
+    case "$prev" in
+        --help|--print-ac-dir|--version)
+            return 0
+            ;;
+        --acdir|-I)
+            _filedir -d
+            return 0
+            ;;
+        --output)
+            _filedir
+            return 0
+            ;;
+        --warnings|-W)
+            local cats=( syntax unsupported )
+            COMPREPLY=( $( compgen -W \
+                '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) )
+            return 0
+            ;;
+    esac
+
+    $split && return 0
+
+    _longopt $1
+} &&
+complete -F _aclocal aclocal aclocal-1.11
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/test/completion/aclocal.exp b/test/completion/aclocal.exp
new file mode 100644
index 0000000..477921a
--- /dev/null
+++ b/test/completion/aclocal.exp
@@ -0,0 +1 @@
+assert_source_completions aclocal
diff --git a/test/completion/autoheader.exp b/test/completion/autoheader.exp
new file mode 100644
index 0000000..b797371
--- /dev/null
+++ b/test/completion/autoheader.exp
@@ -0,0 +1 @@
+assert_source_completions autoheader
diff --git a/test/completion/autoreconf.exp b/test/completion/autoreconf.exp
new file mode 100644
index 0000000..337d11f
--- /dev/null
+++ b/test/completion/autoreconf.exp
@@ -0,0 +1 @@
+assert_source_completions autoreconf
diff --git a/test/completion/autoscan.exp b/test/completion/autoscan.exp
new file mode 100644
index 0000000..9fc7685
--- /dev/null
+++ b/test/completion/autoscan.exp
@@ -0,0 +1 @@
+assert_source_completions autoscan
diff --git a/test/completion/autoupdate.exp b/test/completion/autoupdate.exp
new file mode 100644
index 0000000..f56f4c6
--- /dev/null
+++ b/test/completion/autoupdate.exp
@@ -0,0 +1 @@
+assert_source_completions autoupdate
diff --git a/test/lib/completions/a2ps.exp b/test/lib/completions/aclocal.exp
similarity index 79%
copy from test/lib/completions/a2ps.exp
copy to test/lib/completions/aclocal.exp
index 77cd07f..da133aa 100644
--- a/test/lib/completions/a2ps.exp
+++ b/test/lib/completions/aclocal.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "a2ps "
+assert_complete_any "aclocal "
 
 
 sync_after_int
diff --git a/test/lib/completions/ant.exp b/test/lib/completions/autoheader.exp
similarity index 77%
copy from test/lib/completions/ant.exp
copy to test/lib/completions/autoheader.exp
index de57f24..d85d460 100644
--- a/test/lib/completions/ant.exp
+++ b/test/lib/completions/autoheader.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "ant -"
+assert_complete_any "autoheader "
 
 
 sync_after_int
diff --git a/test/lib/completions/ant.exp b/test/lib/completions/autoreconf.exp
similarity index 77%
copy from test/lib/completions/ant.exp
copy to test/lib/completions/autoreconf.exp
index de57f24..98808fb 100644
--- a/test/lib/completions/ant.exp
+++ b/test/lib/completions/autoreconf.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "ant -"
+assert_complete_any "autoreconf "
 
 
 sync_after_int
diff --git a/test/lib/completions/a2ps.exp b/test/lib/completions/autoscan.exp
similarity index 78%
copy from test/lib/completions/a2ps.exp
copy to test/lib/completions/autoscan.exp
index 77cd07f..f75da81 100644
--- a/test/lib/completions/a2ps.exp
+++ b/test/lib/completions/autoscan.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "a2ps "
+assert_complete_any "autoscan "
 
 
 sync_after_int
diff --git a/test/lib/completions/ant.exp b/test/lib/completions/autoupdate.exp
similarity index 77%
copy from test/lib/completions/ant.exp
copy to test/lib/completions/autoupdate.exp
index de57f24..c83912d 100644
--- a/test/lib/completions/ant.exp
+++ b/test/lib/completions/autoupdate.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "ant -"
+assert_complete_any "autoupdate "
 
 
 sync_after_int

-- 
bash-completion



More information about the Bash-completion-commits mailing list