Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] discard sed stderr in _mime_types
- X-seq: zsh-workers 33081
- From: Mark Oteiza <mvoteiza@xxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] discard sed stderr in _mime_types
- Date: Mon, 01 Sep 2014 03:53:47 -0400
- Cancel-lock: sha1:ooeTViep+Jh6VWhkfhTZWF+qvIE=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
---
Hi,
~/.mime.types need not exist despite the fact that /etc/mime.types
generally does, so let's not have sed complaining about ENOENT and
ruining the completion
Mark
diff -aur a/Completion/Unix/Type/_mime_types b/Completion/Unix/Type/_mime_types
--- a/Completion/Unix/Type/_mime_types 2014-09-01 03:42:17.770140002 -0400
+++ b/Completion/Unix/Type/_mime_types 2014-09-01 03:42:50.990020179 -0400
@@ -33,10 +33,10 @@
compset -p $(( ${#maintype} + 1 ))
_wanted mime-subtypes expl 'MIME subtype' \
compadd -- $(sed -ne "s%^\(type=\|\)${maintype}/\([^ ]*\).*$%\2%p" \
- $type_files)
+ $type_files 2>/dev/null)
else
# Search for main type.
_wanted mime-types expl 'MIME type' \
compadd -S/ -- $(sed -ne "s/^type=//" \
- -e "s%^\(${PREFIX:-[a-z]}[^=\"]*\)/.*$%\1%p" $type_files)
+ -e "s%^\(${PREFIX:-[a-z]}[^=\"]*\)/.*$%\1%p" $type_files 2>/dev/null)
fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author