X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=completion%2Fnotmuch-completion.bash;h=d44b2a2811f016ce052296f61a8c12bbc77cf3d8;hp=960275d1f6727b139d2b2ccd680d95c982b4eec4;hb=4d486cf94d3fcfe4f07daf7dc65c9de04c7cfdd5;hpb=76f8498df61577c2f2e8f22e34a93a37ea532a03 diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash index 960275d1..d44b2a28 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 <