On 24.9.2012, at 14.44, A.L.E.C wrote:
next is "run" or "pipe", but what if you create global separator option and detect multi-command syntax usage automatically without a keyword?
Syntax for doveadm would be
doveadm [-Dv] [-f formatter] [-s separator] [-A | -u wildcards ] command [command_options] [command_arguments] [separator command [command_options] [command_arguments] [...]]
and example
doveadm -A -s : expunge mailbox Trash savedbefore 7d : purge
Hmm. Yes, that might work. Although it would have to be:
doveadm expunge -A -s : mailbox Trash savedbefore 7d : purge
because both -A and -s are mail command specific parameters, which won't work for non-mail commands.
Hmm. This reminds me also that it would be possible with some extra work to do some command interaction. IMAP supports saving search results, which can later be accessed with $ parameter. So this could be made to work:
doveadm search -s : from foo : fetch text \$ : expunge \$