Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] discard sed stderr in _mime_types



---
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