[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-446-gc3d29e2

Ville Skyttä ville.skytta at iki.fi
Mon Oct 3 20:39:31 UTC 2011


The following commit has been merged in the master branch:
commit c3d29e2e0d088b9c082161911b0409d94fc444b6
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Mon Oct 3 23:39:20 2011 +0300

    file: New completion.

diff --git a/completions/Makefile.am b/completions/Makefile.am
index 89d764e..752bb61 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -48,6 +48,7 @@ bashcomp_DATA = abook \
 		e2fsprogs \
 		evince \
 		feh \
+		file \
 		findutils \
 		freeciv \
 		freerdp \
diff --git a/completions/chrpath b/completions/file
similarity index 57%
copy from completions/chrpath
copy to completions/file
index 5d40203..9b190eb 100644
--- a/completions/chrpath
+++ b/completions/file
@@ -1,16 +1,21 @@
-have chrpath || return
+have file || return
 
-_chrpath()
+_file()
 {
     local cur prev words cword
     _init_completion || return
 
     case $prev in
-        -v|--version|-h|--help)
+        --help|-v|--version|-F|--separator)
             return
             ;;
-        -r|--replace)
-            _filedir -d
+        -m|--magic-file|-f|--files-from)
+            _filedir
+            return
+            ;;
+        -e|--exclude)
+            COMPREPLY=( $( compgen -W 'ascii apptype compress elf soft tar
+                tokens troff' -- "$cur" ) )
             return
             ;;
     esac
@@ -22,7 +27,7 @@ _chrpath()
 
     _filedir
 } &&
-complete -F _chrpath chrpath
+complete -F _file file
 
 # Local variables:
 # mode: shell-script
diff --git a/test/completion/file.exp b/test/completion/file.exp
new file mode 100644
index 0000000..92662f0
--- /dev/null
+++ b/test/completion/file.exp
@@ -0,0 +1 @@
+assert_source_completions file
diff --git a/test/lib/completions/ping.exp b/test/lib/completions/file.exp
similarity index 69%
copy from test/lib/completions/ping.exp
copy to test/lib/completions/file.exp
index 9ef7f2f..346960b 100644
--- a/test/lib/completions/ping.exp
+++ b/test/lib/completions/file.exp
@@ -11,10 +11,10 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "ping "
+assert_complete_any "file "
 sync_after_int
 
-assert_complete_any "ping -"
+assert_complete_any "file -"
 sync_after_int
 
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list