[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.90-151-gbed5694

Ville Skyttä ville.skytta at iki.fi
Tue Feb 21 20:01:06 UTC 2012


The following commit has been merged in the master branch:
commit bed56941110985446aed52302f437c50b8182524
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Tue Feb 21 22:00:39 2012 +0200

    vmstat: New completion.

diff --git a/completions/Makefile.am b/completions/Makefile.am
index 507a6b7..03165cf 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -321,6 +321,7 @@ bashcomp_DATA = a2x \
 		usermod \
 		valgrind \
 		vipw \
+		vmstat \
 		vncviewer \
 		vpnc \
 		watch \
diff --git a/completions/pwd b/completions/vmstat
similarity index 58%
copy from completions/pwd
copy to completions/vmstat
index 8818b49..1d3ebb3 100644
--- a/completions/pwd
+++ b/completions/vmstat
@@ -1,12 +1,17 @@
-# pwd(1) completion                                        -*- shell-script -*-
+# vmstat(8) completion                                     -*- shell-script -*-
 
-_pwd()
+_vmstat()
 {
     local cur prev words cword
     _init_completion || return
 
     case $prev in
-        --help|--version)
+        -V|-c|-M|-N|-n|-w|-p)
+            return
+            ;;
+        -S)
+            [[ $OSTYPE == *linux* ]] && \
+                COMPREPLY=( $( compgen -W 'k K m M' -- "$cur" ) )
             return
             ;;
     esac
@@ -17,6 +22,6 @@ _pwd()
             COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
     fi
 } &&
-complete -F _pwd pwd
+complete -F _vmstat vmstat
 
 # ex: ts=4 sw=4 et filetype=sh
diff --git a/test/completion/vmstat.exp b/test/completion/vmstat.exp
new file mode 100644
index 0000000..e55f28e
--- /dev/null
+++ b/test/completion/vmstat.exp
@@ -0,0 +1 @@
+assert_source_completions vmstat
diff --git a/test/lib/completions/abook.exp b/test/lib/completions/vmstat.exp
similarity index 78%
copy from test/lib/completions/abook.exp
copy to test/lib/completions/vmstat.exp
index 43f6272..f749322 100644
--- a/test/lib/completions/abook.exp
+++ b/test/lib/completions/vmstat.exp
@@ -9,9 +9,7 @@ proc teardown {} {
 
 
 setup
-
-
-assert_complete_any "abook "
+assert_complete_any "vmstat -"
 
 
 sync_after_int

-- 
bash-completion



More information about the Bash-completion-commits mailing list