X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=completion%2Fnotmuch-completion.bash;h=72a75a94abf96cb4bd77a67674123a8aa61016ef;hp=78047b5f424de5bf9b6d55548d6c960e1bbceb8f;hb=c5356b9ed56e42d36ca18206155b62c94cfbd79d;hpb=6a833a6e83865f6999707cc30768d07e1351c2cb diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash index 78047b5f..72a75a94 100644 --- a/completion/notmuch-completion.bash +++ b/completion/notmuch-completion.bash @@ -58,6 +58,34 @@ _notmuch_email() sed 's/[^<]*<\([^>]*\)>/\1/' | tr "[:upper:]" "[:lower:]" | sort -u } +_notmuch_mimetype() +{ + # use mime types from mime-support package if available, and fall + # back to a handful of common ones otherwise + if [ -r "/etc/mime.types" ]; then + sed -n '/^[[:alpha:]]/{s/[[:space:]].*//;p;}' /etc/mime.types + else + cat <