summaryrefslogtreecommitdiff
path: root/completions/lzma
diff options
context:
space:
mode:
Diffstat (limited to 'completions/lzma')
-rw-r--r--completions/lzma21
1 files changed, 6 insertions, 15 deletions
diff --git a/completions/lzma b/completions/lzma
index 295ef37b..d377d15f 100644
--- a/completions/lzma
+++ b/completions/lzma
@@ -1,12 +1,10 @@
-# lzma(1) completion by Per Øyvind Karlsen <peroyvind@mandriva.org>
+# lzma(1) completion -*- shell-script -*-
+# by Per Øyvind Karlsen <peroyvind@mandriva.org>
-have lzma &&
_lzma()
{
- local cur prev xspec
-
- COMPREPLY=()
- _get_comp_words_by_ref cur prev
+ local cur prev words cword
+ _init_completion || return
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-1 -2 -3 -4 -5 -6 -7 -8 -9 \
@@ -16,9 +14,8 @@ _lzma()
return 0
fi
- local IFS=$'\n'
+ local IFS=$'\n' xspec="*.@(lzma|tlz)"
- xspec="*.@(lzma|tlz)"
if [[ "$prev" == --* ]]; then
[[ "$prev" == --decompress || \
"$prev" == --list || \
@@ -31,16 +28,10 @@ _lzma()
_expand || return 0
- _compopt_o_filenames
+ compopt -o filenames
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
$( compgen -d -- "$cur" ) )
} &&
complete -F _lzma lzma
-# 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