mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-30 05:40:58 +01:00
Missed file.
This commit is contained in:
parent
7c4a811134
commit
6e29de366c
1 changed files with 24 additions and 0 deletions
24
Functions/MIME/zsh-mime-contexts
Normal file
24
Functions/MIME/zsh-mime-contexts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Helper for zsh-mime-handler.
|
||||
#
|
||||
# Pass in a zstyle option, a suffix, which might include multiple parts
|
||||
# (e.g. pdf.gz), plus remaining zstyle arguments plus arguments to zstyle.
|
||||
# Try to match the style starting with the longest possible suffix.
|
||||
|
||||
local context suffix option
|
||||
|
||||
option=$1
|
||||
shift
|
||||
suffix=$1
|
||||
shift
|
||||
|
||||
while true; do
|
||||
context=":mime:.${suffix}:"
|
||||
zstyle $option $context "$@" && return 0
|
||||
if [[ $suffix = *.* ]]; then
|
||||
suffix=${suffix#*.}
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue