Add lzma completion (Guillaume Rousse, myself).
This commit is contained in:
parent
a817c658f2
commit
d5aa0dfb88
16
bash_completion
Normal file → Executable file
16
bash_completion
Normal file → Executable file
@ -2085,7 +2085,7 @@ _rpm()
|
|||||||
elif [[ ${COMP_WORDS[1]} == -b* ]]; then
|
elif [[ ${COMP_WORDS[1]} == -b* ]]; then
|
||||||
_filedir 'spec'
|
_filedir 'spec'
|
||||||
else
|
else
|
||||||
_filedir '@(tgz|tar.@(gz|bz2))'
|
_filedir '@(tgz|tar.@(gz|bz2|lzma))'
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
--re@(build|compile))
|
--re@(build|compile))
|
||||||
@ -2097,7 +2097,7 @@ _rpm()
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
--tarbuild)
|
--tarbuild)
|
||||||
_filedir '@(tgz|tar.@(gz|bz2))'
|
_filedir '@(tgz|tar.@(gz|bz2|lzma))'
|
||||||
;;
|
;;
|
||||||
--@(re|add)sign)
|
--@(re|add)sign)
|
||||||
_filedir 'rpm'
|
_filedir 'rpm'
|
||||||
@ -2902,9 +2902,9 @@ _tar()
|
|||||||
_filedir
|
_filedir
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
+([^IZzjy])f)
|
+([^IZzJjy])f)
|
||||||
ext='t@(ar?(.@(Z|gz|bz?(2)))|gz|bz?(2))'
|
ext='t@(ar?(.@(Z|gz|bz?(2)|lz?(ma)))|gz|bz?(2)|lz?(ma))'
|
||||||
regex='t\(ar\(\.\(Z\|gz\|bz2\?\)\)\?\|gz\|bz2\?\)'
|
regex='t\(ar\(\.\(Z\|gz\|bz2\?\|lzma\)\)\?\|gz\|bz2\?\|lzma\)'
|
||||||
;;
|
;;
|
||||||
*[Zz]*f)
|
*[Zz]*f)
|
||||||
ext='t?(ar.)@(gz|Z)'
|
ext='t?(ar.)@(gz|Z)'
|
||||||
@ -2914,6 +2914,10 @@ _tar()
|
|||||||
ext='t?(ar.)bz?(2)'
|
ext='t?(ar.)bz?(2)'
|
||||||
regex='t\(ar\.\)\?bz2\?'
|
regex='t\(ar\.\)\?bz2\?'
|
||||||
;;
|
;;
|
||||||
|
*[J]*f)
|
||||||
|
ext='t?(ar.)lz?(ma)'
|
||||||
|
regex='t\(ar\.\)\?lzma\?'
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
_filedir
|
_filedir
|
||||||
return 0
|
return 0
|
||||||
@ -7344,7 +7348,7 @@ _info()
|
|||||||
fi;
|
fi;
|
||||||
done
|
done
|
||||||
# strip suffix from info pages
|
# strip suffix from info pages
|
||||||
COMPREPLY=( ${COMPREPLY[@]%.@(gz|bz2)} )
|
COMPREPLY=( ${COMPREPLY[@]%.@(gz|bz2|lzma)} )
|
||||||
COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) )
|
COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) )
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
39
contrib/lzma
Normal file
39
contrib/lzma
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# lzma(1) completion
|
||||||
|
#
|
||||||
|
have lzma &&
|
||||||
|
_lzma()
|
||||||
|
{
|
||||||
|
local cur prev xspec
|
||||||
|
|
||||||
|
COMPREPLY=()
|
||||||
|
cur=`_get_cword`
|
||||||
|
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||||
|
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=( $( compgen -W '-c -d -f -h -k -L -q -s \
|
||||||
|
-v -V -z -1 -2 -3 -4 -5 -6 -7 -8 -9 \
|
||||||
|
--help --decompress --compress --keep --force \
|
||||||
|
--test --stdout --quiet --verbose --license \
|
||||||
|
--version --small --fast --best --text' -- $cur ) )
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
local IFS=$'\t\n'
|
||||||
|
|
||||||
|
xspec="*.lzma"
|
||||||
|
if [[ "$prev" == --* ]]; then
|
||||||
|
[[ "$prev" == --decompress || \
|
||||||
|
"$prev" == --list || \
|
||||||
|
"$prev" == --test ]] && xspec="!"$xspec
|
||||||
|
[[ "$prev" == --compress ]] && xspec=
|
||||||
|
elif [[ "$prev" == -* ]]; then
|
||||||
|
[[ "$prev" == -*[dt]* ]] && xspec="!"$xspec
|
||||||
|
[[ "$prev" == -*z* ]] && xspec=
|
||||||
|
fi
|
||||||
|
|
||||||
|
_expand || return 0
|
||||||
|
|
||||||
|
COMPREPLY=( $( compgen -f -X "$xspec" -- $cur ) \
|
||||||
|
$( compgen -d -- $cur ) )
|
||||||
|
} &&
|
||||||
|
complete -F _lzma $filenames lzma
|
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -66,6 +66,7 @@ bash-completion (200811xx) UNRELEASED; urgency=low
|
|||||||
* Improved getent completion (Ville Skyttä, Guillaume Rousse).
|
* Improved getent completion (Ville Skyttä, Guillaume Rousse).
|
||||||
* (Re)fix gzip and bzip2 options completion (Ville Skyttä).
|
* (Re)fix gzip and bzip2 options completion (Ville Skyttä).
|
||||||
* Improved svn filename completion (RHBZ: #430059) (Ville Skyttä).
|
* Improved svn filename completion (RHBZ: #430059) (Ville Skyttä).
|
||||||
|
* Add lzma completion (Guillaume Rousse, Ville Skyttä).
|
||||||
* Merge from Gentoo:
|
* Merge from Gentoo:
|
||||||
- fix 'find' completion so that it properly completes on -?(i)whilename.
|
- fix 'find' completion so that it properly completes on -?(i)whilename.
|
||||||
Patch by Ciaran McCreesh.
|
Patch by Ciaran McCreesh.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user