2010-08-21 19:44:45 +02:00
|
|
|
#compdef mu
|
|
|
|
|
2011-05-24 21:43:22 +02:00
|
|
|
## Copyright (C) 2008-2011 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
2010-08-21 19:44:45 +02:00
|
|
|
##
|
|
|
|
## 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
|
|
|
|
## the Free Software Foundation; either version 3 of the License, or
|
|
|
|
## (at your option) any later version.
|
|
|
|
##
|
|
|
|
## This program is distributed in the hope that it will be useful,
|
|
|
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
## 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, write to the Free Software Foundation,
|
|
|
|
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
# zsh completion for mu.
|
|
|
|
|
|
|
|
_mu_commands() {
|
|
|
|
local -a mu_commands
|
|
|
|
mu_commands=(
|
|
|
|
'index:scan your maildirs and import their metadata in the database'
|
|
|
|
'find:search for messages in the database'
|
2011-05-24 21:43:22 +02:00
|
|
|
'cfind:search for contacts (name + email) in the database'
|
2011-05-25 21:04:32 +02:00
|
|
|
'cleanup:remove deleted messages from the database'
|
2010-08-21 19:44:45 +02:00
|
|
|
'extract:list message-parts (attachments) and extract them to files'
|
|
|
|
'mkdir:create maildirs'
|
2010-09-05 12:44:04 +02:00
|
|
|
'view:display specific messages')
|
2010-08-21 19:44:45 +02:00
|
|
|
|
|
|
|
_describe -t command 'command' mu_commands
|
|
|
|
}
|
|
|
|
|
2010-09-05 12:44:04 +02:00
|
|
|
_mu_common_options=(
|
|
|
|
'--debug[output information useful for debugging mu]'
|
|
|
|
'--quiet[do not give any non-critical information]'
|
2011-06-16 07:14:39 +02:00
|
|
|
'--color[use colors in some of the output]'
|
2010-09-05 12:44:04 +02:00
|
|
|
'--version[display mu version and copyright information]'
|
|
|
|
'--log-stderr[log to standard error]'
|
|
|
|
)
|
|
|
|
|
|
|
|
_mu_db_options=(
|
2011-05-24 21:43:22 +02:00
|
|
|
'--muhome[use some non-default location for the mu database]:directory:_files'
|
2010-09-05 12:44:04 +02:00
|
|
|
)
|
|
|
|
|
2011-05-24 21:43:22 +02:00
|
|
|
_mu_find_options=(
|
|
|
|
'--fields[fields to display in the output]'
|
|
|
|
'--sortfield[field to sort the output by]'
|
|
|
|
'--descending[sort in descending order]'
|
2011-05-25 21:04:32 +02:00
|
|
|
'--summary[include a summary of the message]'
|
2011-05-24 21:43:22 +02:00
|
|
|
'--bookmark[use a named bookmark]'
|
|
|
|
'--output[set the kind of output for the query]'
|
|
|
|
)
|
|
|
|
|
2011-05-25 21:04:32 +02:00
|
|
|
_mu_view_options=(
|
|
|
|
'--summary[only show a summary of the message]'
|
|
|
|
)
|
2011-05-24 21:43:22 +02:00
|
|
|
|
2010-09-05 12:44:04 +02:00
|
|
|
|
2010-08-21 19:44:45 +02:00
|
|
|
_mu_view() {
|
2011-05-25 21:04:32 +02:00
|
|
|
_arguments -s : \
|
|
|
|
$_mu_common_options \
|
|
|
|
$_mu_view_options
|
2010-08-21 19:44:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
_mu_extract() {
|
2010-09-05 12:44:04 +02:00
|
|
|
_files
|
2010-08-21 19:44:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
_mu_find() {
|
2010-09-05 12:44:04 +02:00
|
|
|
_arguments -s : \
|
2011-05-24 21:43:22 +02:00
|
|
|
$_mu_common_options \
|
|
|
|
$_mu_db_options \
|
|
|
|
$_mu_find_options
|
2010-08-21 19:44:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
_mu_index() {
|
2010-09-05 12:44:04 +02:00
|
|
|
_arguments -s : \
|
|
|
|
$_mu_db_options \
|
|
|
|
$_mu_common_options
|
2010-08-21 19:44:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
_mu_cleanup() {
|
2010-09-05 12:44:04 +02:00
|
|
|
_arguments -s : \
|
|
|
|
$_mu_db_options \
|
|
|
|
$_mu_common_options
|
2010-08-21 19:44:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_mu_mkdir() {
|
|
|
|
_arguments -s : \
|
2010-09-05 12:44:04 +02:00
|
|
|
'--mode=[file mode for the new Maildir]:file mode: ' \
|
|
|
|
$_mu_common_options
|
2010-08-21 19:44:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
_mu() {
|
|
|
|
if (( CURRENT > 2 )) ; then
|
|
|
|
local cmd=${words[2]}
|
|
|
|
curcontext="${curcontext%:*:*}:mu-$cmd"
|
|
|
|
(( CURRENT-- ))
|
|
|
|
shift words
|
|
|
|
_call_function ret _mu_$cmd
|
|
|
|
return ret
|
|
|
|
else
|
|
|
|
_mu_commands
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_mu "$@"
|
|
|
|
|
2010-08-23 07:23:58 +02:00
|
|
|
# Local variables:
|
|
|
|
# mode: sh
|
|
|
|
# End:
|