[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 2.0-135-g7a1aad7

Ville Skyttä ville.skytta at iki.fi
Fri Feb 22 16:26:53 UTC 2013


The following commit has been merged in the master branch:
commit 7a1aad780e9f64ad213caed8aa71f45e12294e63
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Fri Feb 22 18:26:41 2013 +0200

    file-roller: New completion.

diff --git a/completions/Makefile.am b/completions/Makefile.am
index 294f0e6..b15b7df 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -87,6 +87,7 @@ bashcomp_DATA = a2x \
 		fbi \
 		feh \
 		file \
+		file-roller \
 		filefrag \
 		filesnarf \
 		find \
diff --git a/completions/file-roller b/completions/file-roller
new file mode 100644
index 0000000..c05565d
--- /dev/null
+++ b/completions/file-roller
@@ -0,0 +1,41 @@
+# file-roller(1) completion                                -*- shell-script -*-
+
+_file_roller()
+{
+    local cur prev words cword split
+    _init_completion -s || return
+
+    local exts='@(7z|ace|alz|ar|arj|[bglx]z|bz2|tb?(z)2|cab|cb[rz]|iso?(9660)|Z|t[abglx]z|cpio|deb|[ejrw]ar|exe|?(g)tar|gem|lh[az]|lzh|?(t)lrz|lzma|lzo|wim|swm|rpm|sit|zip|zoo)'
+
+    case $prev in
+        -'?'|--help|--help-all|--help-gtk|--help-sm-client)
+            return
+            ;;
+        --sm-client-state-file)
+            _filedir
+            return
+            ;;
+        -a|--add-to)
+            _filedir "$exts"
+            return
+            ;;
+        -e|--extract-to|--default-dir)
+            _filedir -d
+            return
+            ;;
+    esac
+
+    $split && return
+
+    if [[ $cur == -* ]]; then
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \
+            -- "$cur" ) )
+        [[ $COMPREPLY == *= ]] && compopt -o nospace
+        return
+    fi
+
+    _filedir "$exts"
+} &&
+complete -F _file_roller file-roller
+
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/test/completion/file-roller.exp b/test/completion/file-roller.exp
new file mode 100644
index 0000000..2208ba1
--- /dev/null
+++ b/test/completion/file-roller.exp
@@ -0,0 +1 @@
+assert_source_completions file-roller
diff --git a/test/lib/completions/abook.exp b/test/lib/completions/file-roller.exp
similarity index 76%
copy from test/lib/completions/abook.exp
copy to test/lib/completions/file-roller.exp
index 43f6272..942941d 100644
--- a/test/lib/completions/abook.exp
+++ b/test/lib/completions/file-roller.exp
@@ -11,9 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "abook "
-
-
+assert_complete_any "file-roller "
 sync_after_int
 
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list