[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 45668c23d37f6dfbf8771866c2a6f85ba3e45e67
Ville Skyttä
ville.skytta at iki.fi
Tue Sep 14 18:04:59 UTC 2010
The following commit has been merged in the master branch:
commit 3b7ed984597d0b5a8e7234a3a1084370353a425c
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Tue Sep 14 21:00:31 2010 +0300
Add xmodmap and xrdb completions.
diff --git a/CHANGES b/CHANGES
index 65102c2..0e254a2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -8,7 +8,7 @@ bash-completion (2.x)
[ Ville Skyttä ]
* Activate hping2 completion also for hping and hping3.
- * Add crontab, iftop, lrzip, and POSIX sh completions.
+ * Add crontab, iftop, lrzip, POSIX sh, xmodmap, and xrdb completions.
* Add *.gif (Alioth: #312512), *.3gpp, *.3gpp2, and *.awb to mplayer
filename completions.
* Add "short" tarball extensions to unxz, unlzma etc completions.
diff --git a/completions/Makefile.am b/completions/Makefile.am
index 86f6225..ffd3fde 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -162,7 +162,9 @@ bashcomp_DATA = abook \
xmllint \
xmlwf \
xmms \
+ xmodmap \
xrandr \
+ xrdb \
xsltproc \
xz \
yp-tools \
diff --git a/completions/rpmcheck b/completions/xmodmap
similarity index 52%
copy from completions/rpmcheck
copy to completions/xmodmap
index 5d9aada..f4f2915 100644
--- a/completions/rpmcheck
+++ b/completions/xmodmap
@@ -1,28 +1,27 @@
-# bash completion for rpmcheck
+# xmodmap(1) completion
-have rpmcheck &&
-_rpmcheck()
+have xmodmap &&
+_xmodmap()
{
- local cur prev
-
COMPREPLY=()
+ local cur prev
_get_comp_words_by_ref cur prev
case $prev in
- -base)
- _filedir
+ -display|-e)
return 0
;;
esac
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '-explain -failures -successes \
- -dump -dump-all -base -help -compressed-input' -- "$cur" ) )
- else
- _filedir
+ COMPREPLY=( $( compgen -W '-display -help -grammar -verbose -quiet -n
+ -e -pm -pk -pke -pp' -- "$cur" ) )
+ return 0
fi
+
+ _filedir
} &&
-complete -F _rpmcheck rpmcheck $files
+complete -F _xmodmap -o filenames xmodmap
# Local variables:
# mode: shell-script
diff --git a/completions/tcpdump b/completions/xrdb
similarity index 51%
copy from completions/tcpdump
copy to completions/xrdb
index 259f13e..423c092 100644
--- a/completions/tcpdump
+++ b/completions/xrdb
@@ -1,32 +1,32 @@
-# bash completion for tcpdump
+# xrdb(1) completion
-have tcpdump &&
-_tcpdump()
+have xrdb &&
+_xrdb()
{
- local cur prev
-
COMPREPLY=()
+ local cur prev
_get_comp_words_by_ref cur prev
case $prev in
- -r|-w|-F)
- _filedir
+ -backup|-display|-help)
return 0
;;
- -i)
- _available_interfaces -a
+ -cpp|-edit)
+ _filedir
return 0
;;
esac
-
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '-a -d -e -f -l -n -N -O -p \
- -q -R -S -t -u -v -x -C -F -i -m -r -s -T -w -E' -- "$cur" ) )
+ COMPREPLY=( $( compgen -W '-help -display -all -global -screen -screens
+ -n -quiet -cpp -nocpp -symbols -query -load -override -merge
+ -remove -retain -edit -backup' -- "$cur" ) )
+ return 0
fi
+ _filedir
} &&
-complete -F _tcpdump tcpdump
+complete -F _xrdb -o filenames xrdb
# Local variables:
# mode: shell-script
diff --git a/test/completion/xmodmap.exp b/test/completion/xmodmap.exp
new file mode 100644
index 0000000..a80bb02
--- /dev/null
+++ b/test/completion/xmodmap.exp
@@ -0,0 +1 @@
+assert_source_completions xmodmap
diff --git a/test/completion/xrdb.exp b/test/completion/xrdb.exp
new file mode 100644
index 0000000..522ac31
--- /dev/null
+++ b/test/completion/xrdb.exp
@@ -0,0 +1 @@
+assert_source_completions xrdb
diff --git a/test/lib/completions/animate.exp b/test/lib/completions/xmodmap.exp
similarity index 79%
copy from test/lib/completions/animate.exp
copy to test/lib/completions/xmodmap.exp
index 12314d7..2bf4da1 100644
--- a/test/lib/completions/animate.exp
+++ b/test/lib/completions/xmodmap.exp
@@ -11,7 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "animate "
+assert_complete_any "xmodmap "
sync_after_int
diff --git a/test/lib/completions/awk.exp b/test/lib/completions/xrdb.exp
similarity index 80%
copy from test/lib/completions/awk.exp
copy to test/lib/completions/xrdb.exp
index 260dabc..f02625d 100644
--- a/test/lib/completions/awk.exp
+++ b/test/lib/completions/xrdb.exp
@@ -11,7 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "awk "
+assert_complete_any "xrdb "
sync_after_int
--
bash-completion
More information about the Bash-completion-commits
mailing list