X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=completion%2Fnotmuch-completion.bash;h=15425697a215290e79a4d58e7cdf4884f3a5f2bc;hp=1552c1e51db7403aba3d791dce045317f846f9c0;hb=HEAD;hpb=326824aee38c64ce80c50feac92c10dba4bb4879 diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash index 1552c1e5..3748846e 100644 --- a/completion/notmuch-completion.bash +++ b/completion/notmuch-completion.bash @@ -3,7 +3,7 @@ # Copyright © 2013 Jani Nikula # # Based on the bash-completion package: -# http://bash-completion.alioth.debian.org/ +# https://github.com/scop/bash-completion # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see http://www.gnu.org/licenses/ . +# along with this program. If not, see https://www.gnu.org/licenses/ . # # Author: Jani Nikula # @@ -27,6 +27,8 @@ # on completion. # +_notmuch_shared_options="--help --uuid= --version" + # $1: current input of the form prefix:partialinput, where prefix is # to or from. _notmuch_email() @@ -56,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 <