[PATCH v2 01/10] cli: search: Rename options to context

2014-11-03 Thread Michal Sojka
Just text replacement, no other changes. --- notmuch-search.c | 142 +++ 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c index 6345fb6..2c47b80 100644 --- a/notmuch-search.c +++

[PATCH v2 00/10] notmuch address command

2014-11-03 Thread Michal Sojka
support for hierarchical command line option arrays Michal Sojka (9): cli: search: Rename options to context cli: search: Move more variables into search_context_t cli: search: Convert ctx. to ctx- cli: search: Split notmuch_search_command to smaller functions cli: Introduce notmuch address

[PATCH v2 08/10] cli: address: Do not output duplicate addresses

2014-11-03 Thread Michal Sojka
This filters out duplicate addresses from address command output. It also also adds tests for the address command. The code here is an extended version of a patch from Jani Nikula. --- doc/man1/notmuch-address.rst | 2 +- notmuch-search.c | 40 -

[PATCH v2 09/10] cli: address: Add --output=count

2014-11-03 Thread Michal Sojka
This output prints how many times was each address encountered during search. --- completion/notmuch-completion.bash | 2 +- completion/notmuch-completion.zsh | 2 +- doc/man1/notmuch-address.rst | 7 ++ notmuch-search.c | 49 --

[PATCH v2 05/10] cli: add support for hierarchical command line option arrays

2014-11-03 Thread Michal Sojka
From: Jani Nikula j...@nikula.org NOTMUCH_OPT_INHERIT expects a notmuch_opt_desc_t * pointer in output_var. The Unrecognized option message was moved out of parse_option() to not be emitted twice or when parsing a non-inherited option. --- command-line-arguments.c | 16 +---

[PATCH v2 03/10] cli: search: Convert ctx. to ctx-

2014-11-03 Thread Michal Sojka
Mostly text replacement. --- notmuch-search.c | 81 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c index 3d2012b..6765a16 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -474,7

[PATCH v2 07/10] cli: search: Convert --output to keyword argument

2014-11-03 Thread Michal Sojka
Now, when address related outputs are in a separate command, it makes no sense to combine multiple --output options in search command line. Using switch statement to handle different outputs is more readable than a series of if statements. --- doc/man1/notmuch-search.rst | 3 ---

[PATCH v6 6/7] cli: search: Add --output=count

2014-11-02 Thread Michal Sojka
On 2. listopadu 2014 10:29:28 CET, Mark Walters wrote: > >Hi > >On Sun, 02 Nov 2014, Michal Sojka wrote: >> On Sat, Nov 01 2014, Mark Walters wrote: >>> On Fri, 31 Oct 2014, Michal Sojka wrote: >>>> This output can be used with --output=recipients

[PATCH v6 6/7] cli: search: Add --output=count

2014-11-02 Thread Michal Sojka
On Sat, Nov 01 2014, Mark Walters wrote: > On Fri, 31 Oct 2014, Michal Sojka wrote: >> This output can be used with --output=recipients or --output=sender >> and in addition to the addresses, it prints how many times was each >> address encountered during search. >

[PATCH 10/10] cli: address: Add --filter-by option to configure address filtering

2014-11-02 Thread Michal Sojka
This option allows to configure the criterion for duplicate address filtering. Without this option, all unique combinations of name and address parts are printed. This option allows to filter the output more, for example to only contain unique address parts. --- completion/notmuch-completion.bash

[PATCH 09/10] cli: address: Add --output=count

2014-11-02 Thread Michal Sojka
This output prints how many times was each address encountered during search. --- completion/notmuch-completion.bash | 2 +- completion/notmuch-completion.zsh | 2 +- doc/man1/notmuch-address.rst | 7 ++ notmuch-search.c | 49 --

[PATCH 08/10] cli: address: Do not output duplicate addresses

2014-11-02 Thread Michal Sojka
This filters out duplicate addresses from address command output. It also also adds tests for the address command. The code here is an extended version of a patch from Jani Nikula. --- doc/man1/notmuch-address.rst | 2 +- notmuch-search.c | 40 -

[PATCH 07/10] cli: search: Convert --output to keyword argument

2014-11-02 Thread Michal Sojka
Now, when address related outputs are in a separate command, it makes no sense to combine multiple --output options in search command line. Using switch statement to handle different outputs is more readable than a series of if statements. --- doc/man1/notmuch-search.rst | 3 ---

[PATCH 06/10] cli: Introduce "notmuch address" command

2014-11-02 Thread Michal Sojka
This moves address-related functionality from search command to the new address command. The implementation shares almost all code and some command line options. Options --offset and --limit were intentionally not included in the address command, because they refer to messages numbers, which

[PATCH 05/10] cli: add support for hierarchical command line option arrays

2014-11-02 Thread Michal Sojka
From: Jani Nikula NOTMUCH_OPT_INHERIT expects a notmuch_opt_desc_t * pointer in output_var. --- command-line-arguments.c | 14 -- command-line-arguments.h | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/command-line-arguments.c

[PATCH 04/10] cli: search: Split notmuch_search_command to smaller functions

2014-11-02 Thread Michal Sojka
In the next commit, these functions will be used to share some functionality between search and address commands. --- notmuch-search.c | 155 ++- 1 file changed, 86 insertions(+), 69 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c

[PATCH 03/10] cli: search: Convert ctx. to ctx->

2014-11-02 Thread Michal Sojka
Mostly text replacement. --- notmuch-search.c | 77 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c index 70e7d1b..ad7a92a 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -453,7

[PATCH 02/10] cli: search: Move more variables into search_context_t

2014-11-02 Thread Michal Sojka
Just refactoring, no functional changes. --- notmuch-search.c | 49 ++--- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c index c354ddc..70e7d1b 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@

[PATCH 01/10] cli: search: Rename options to context

2014-11-02 Thread Michal Sojka
Just text replacement, no other changes. --- notmuch-search.c | 136 +++ 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c index 671fe41..c354ddc 100644 --- a/notmuch-search.c +++

[PATCH 00/10] "notmuch address" command

2014-11-02 Thread Michal Sojka
org Jani Nikula (1): cli: add support for hierarchical command line option arrays Michal Sojka (9): cli: search: Rename options to context cli: search: Move more variables into search_context_t cli: search: Convert ctx. to ctx-> cli: search: Split notmuch_search_command to smaller fu

Re: [PATCH v6 6/7] cli: search: Add --output=count

2014-11-02 Thread Michal Sojka
On 2. listopadu 2014 10:29:28 CET, Mark Walters markwalters1...@gmail.com wrote: Hi On Sun, 02 Nov 2014, Michal Sojka sojk...@fel.cvut.cz wrote: On Sat, Nov 01 2014, Mark Walters wrote: On Fri, 31 Oct 2014, Michal Sojka sojk...@fel.cvut.cz wrote: This output can be used with --output

[PATCH v6 7/7] cli: search: Add --filter-by option to configure address filtering

2014-11-01 Thread Michal Sojka
On Sat, Nov 01 2014, Jani Nikula wrote: > On Fri, 31 Oct 2014, Michal Sojka wrote: >> This option allows to configure the criterion for duplicate address >> filtering. Without this option, all unique combinations of name and >> address parts are printed. This option allows

Re: [PATCH v6 7/7] cli: search: Add --filter-by option to configure address filtering

2014-11-01 Thread Michal Sojka
On Sat, Nov 01 2014, Jani Nikula wrote: On Fri, 31 Oct 2014, Michal Sojka sojk...@fel.cvut.cz wrote: This option allows to configure the criterion for duplicate address filtering. Without this option, all unique combinations of name and address parts are printed. This option allows to filter

[PATCH 02/10] cli: search: Move more variables into search_context_t

2014-11-01 Thread Michal Sojka
Just refactoring, no functional changes. --- notmuch-search.c | 49 ++--- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c index c354ddc..70e7d1b 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@

[PATCH 01/10] cli: search: Rename options to context

2014-11-01 Thread Michal Sojka
Just text replacement, no other changes. --- notmuch-search.c | 136 +++ 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c index 671fe41..c354ddc 100644 --- a/notmuch-search.c +++

[PATCH 07/10] cli: search: Convert --output to keyword argument

2014-11-01 Thread Michal Sojka
Now, when address related outputs are in a separate command, it makes no sense to combine multiple --output options in search command line. Using switch statement to handle different outputs is more readable than a series of if statements. --- doc/man1/notmuch-search.rst | 3 ---

[PATCH 08/10] cli: address: Do not output duplicate addresses

2014-11-01 Thread Michal Sojka
This filters out duplicate addresses from address command output. It also also adds tests for the address command. The code here is an extended version of a patch from Jani Nikula. --- doc/man1/notmuch-address.rst | 2 +- notmuch-search.c | 40 -

[PATCH 06/10] cli: Introduce notmuch address command

2014-11-01 Thread Michal Sojka
This moves address-related functionality from search command to the new address command. The implementation shares almost all code and some command line options. Options --offset and --limit were intentionally not included in the address command, because they refer to messages numbers, which

[PATCH 03/10] cli: search: Convert ctx. to ctx-

2014-11-01 Thread Michal Sojka
Mostly text replacement. --- notmuch-search.c | 77 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c index 70e7d1b..ad7a92a 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -453,7

[PATCH 09/10] cli: address: Add --output=count

2014-11-01 Thread Michal Sojka
This output prints how many times was each address encountered during search. --- completion/notmuch-completion.bash | 2 +- completion/notmuch-completion.zsh | 2 +- doc/man1/notmuch-address.rst | 7 ++ notmuch-search.c | 49 --

[PATCH 05/10] cli: add support for hierarchical command line option arrays

2014-11-01 Thread Michal Sojka
From: Jani Nikula j...@nikula.org NOTMUCH_OPT_INHERIT expects a notmuch_opt_desc_t * pointer in output_var. --- command-line-arguments.c | 14 -- command-line-arguments.h | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/command-line-arguments.c

[PATCH 04/10] cli: search: Split notmuch_search_command to smaller functions

2014-11-01 Thread Michal Sojka
In the next commit, these functions will be used to share some functionality between search and address commands. --- notmuch-search.c | 155 ++- 1 file changed, 86 insertions(+), 69 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c

[PATCH 00/10] notmuch address command

2014-11-01 Thread Michal Sojka
): cli: add support for hierarchical command line option arrays Michal Sojka (9): cli: search: Rename options to context cli: search: Move more variables into search_context_t cli: search: Convert ctx. to ctx- cli: search: Split notmuch_search_command to smaller functions cli: Introduce

Re: [PATCH v6 6/7] cli: search: Add --output=count

2014-11-01 Thread Michal Sojka
On Sat, Nov 01 2014, Mark Walters wrote: On Fri, 31 Oct 2014, Michal Sojka sojk...@fel.cvut.cz wrote: This output can be used with --output=recipients or --output=sender and in addition to the addresses, it prints how many times was each address encountered during search. Hi I have

[PATCH v6 7/7] cli: search: Add --filter-by option to configure address filtering

2014-10-31 Thread Michal Sojka
This option allows to configure the criterion for duplicate address filtering. Without this option, all unique combinations of name and address parts are printed. This option allows to filter the output more, for example to only contain unique address parts. --- completion/notmuch-completion.bash

[PATCH v6 6/7] cli: search: Add --output=count

2014-10-31 Thread Michal Sojka
This output can be used with --output=recipients or --output=sender and in addition to the addresses, it prints how many times was each address encountered during search. --- completion/notmuch-completion.bash | 2 +- completion/notmuch-completion.zsh | 2 +- doc/man1/notmuch-search.rst

[PATCH v6 5/7] cli: search: Do not output duplicate addresses

2014-10-31 Thread Michal Sojka
This filters out duplicate addresses from address outputs (sender, receivers). It also also adds tests for the new outputs. The code here is an extended version of a patch from Jani Nikula. --- doc/man1/notmuch-search.rst | 2 ++ notmuch-search.c| 51 ++

[PATCH v6 4/7] cli: search: Add --output={sender,recipients}

2014-10-31 Thread Michal Sojka
The new outputs allow printing senders, recipients or both of matching messages. To print both, the user can use --output=sender and --output=recipients simultaneously. Currently, the same address can appear multiple times in the output. The next commit will change this. For this reason, tests

[PATCH v6 3/7] cli: search: Convert --output to keyword-flag argument

2014-10-31 Thread Michal Sojka
This converts "notmuch search" to use the recently introduced keyword-flag argument parser. At this point, it only makes the code slightly less readable but following commits that add new --output keywords will profit from this. --- notmuch-search.c | 35 ++- 1

[PATCH v6 2/7] cli: Add support for parsing keyword-flag arguments

2014-10-31 Thread Michal Sojka
From: Jani Nikula <j...@nikula.org> This allows having multiple --foo=bar --foo=baz options on the command line, with the corresponding values OR'd together. [Test added by Michal Sojka] --- command-line-arguments.c | 6 +- command-line-arguments.h | 1 + test/T410-ar

[PATCH v6 1/7] cli: search: Refactor passing of command line options

2014-10-31 Thread Michal Sojka
Many functions that implement the search command need to access command line options. Instead of passing each option in a separate variable, put them in a structure and pass only this structure. This will become handy in the following commits. --- notmuch-search.c | 125

[PATCH v6 0/7] notmuch search --output=sender/recipients

2014-10-31 Thread Michal Sojka
ses. Hopefully, the introduction of --output=count is sufficient replacement for this "feature". Cheers, -Michal Jani Nikula (1): cli: Add support for parsing keyword-flag arguments Michal Sojka (6): cli: search: Refactor passing of command line options cli: search: Convert --outp

[PATCH v5 0/7] notmuch search --output=sender/recipients

2014-10-31 Thread Michal Sojka
ut=recipients > --output=count "tag:notmuch and date:today.." > 2 Jani Nikula > 2 Michal Sojka > 1 David Edmondson > 9 notmuch at notmuchmail.org > > jkr at ladybug [11:01AM] ~ $ notmuch search --output=recipients > --output=count --filter-by=ad

[PATCH v5 0/7] notmuch search --output=sender/recipients

2014-10-31 Thread Michal Sojka
On Fri, Oct 31 2014, Mark Walters wrote: > My only query is in the text output: should the name part be printed as > a quoted string. For example currently I get a line of the form > > Bloggs, Fred Good point. On Fri, Oct 31 2014, Mark Walters wrote: > Hi > > I attach a patch which does the

[PATCH v5 7/7] cli: search: Add --filter-by option to configure address filtering

2014-10-31 Thread Michal Sojka
This option allows to configure the criterion for duplicate address filtering. Without this option, all unique combinations of name and address parts are printed. This option allows to filter the output more, for example to only contain unique address parts. --- completion/notmuch-completion.bash

[PATCH v5 6/7] cli: search: Add --output=count

2014-10-31 Thread Michal Sojka
This output can be used with --output=recipients or --output=sender and in addition to the addresses, it prints how many times was each address encountered during search. --- completion/notmuch-completion.bash | 2 +- completion/notmuch-completion.zsh | 2 +- doc/man1/notmuch-search.rst

[PATCH v5 5/7] cli: search: Do not output duplicate addresses

2014-10-31 Thread Michal Sojka
This filters out duplicate addresses from address outputs (sender, receivers). It also also adds tests for the new outputs. The code here is an extended version of a patch from Jani Nikula. --- doc/man1/notmuch-search.rst | 2 ++ notmuch-search.c| 51 ++

[PATCH v5 4/7] cli: search: Add --output={sender,recipients}

2014-10-31 Thread Michal Sojka
The new outputs allow printing senders, recipients or both of matching messages. To print both, the user can use --output=sender and --output=recipients simultaneously. Currently, the same address can appear multiple times in the output. The next commit will change this. For this reason, tests

[PATCH v5 3/7] cli: search: Convert --output to keyword-flag argument

2014-10-31 Thread Michal Sojka
This converts "notmuch search" to use the recently introduced keyword-flag argument parser. At this point, it only makes the code slightly less readable but following commits that add new --output keywords will profit from this. --- notmuch-search.c | 35 ++- 1

[PATCH v5 2/7] cli: Add support for parsing keyword-flag arguments

2014-10-31 Thread Michal Sojka
From: Jani Nikula <j...@nikula.org> This allows having multiple --foo=bar --foo=baz options on the command line, with the corresponding values OR'd together. [Test added by Michal Sojka] --- command-line-arguments.c | 6 +- command-line-arguments.h | 1 + test/T410-ar

[PATCH v5 1/7] cli: search: Refactor passing of command line options

2014-10-31 Thread Michal Sojka
Many functions that implement the search command need to access command line options. Instead of passing each option in a separate variable, put them in a structure and pass only this structure. This will become handy in the following commits. --- notmuch-search.c | 125

[PATCH v5 0/7] notmuch search --output=sender/recipients

2014-10-31 Thread Michal Sojka
ani Nikula (1): cli: Add support for parsing keyword-flag arguments Michal Sojka (6): cli: search: Refactor passing of command line options cli: search: Convert --output to keyword-flag argument cli: search: Add --output={sender,recipients} cli: search: Do not output duplicate addresses cli

Re: [PATCH v5 0/7] notmuch search --output=sender/recipients

2014-10-31 Thread Michal Sojka
On Fri, Oct 31 2014, Mark Walters wrote: My only query is in the text output: should the name part be printed as a quoted string. For example currently I get a line of the form Bloggs, Fred f...@example.com Good point. On Fri, Oct 31 2014, Mark Walters wrote: Hi I attach a patch which

Re: [PATCH v5 0/7] notmuch search --output=sender/recipients

2014-10-31 Thread Michal Sojka
and date:today.. 2 Jani Nikula j...@nikula.org 2 Michal Sojka sojk...@fel.cvut.cz 1 David Edmondson d...@dme.org 9 notmuch@notmuchmail.org jkr@ladybug [11:01AM] ~ $ notmuch search --output=recipients --output=count --filter-by=addrfold tag:notmuch and date:today.. 2 Michal Sojka

[PATCH v6 1/7] cli: search: Refactor passing of command line options

2014-10-31 Thread Michal Sojka
Many functions that implement the search command need to access command line options. Instead of passing each option in a separate variable, put them in a structure and pass only this structure. This will become handy in the following commits. --- notmuch-search.c | 125

[PATCH v6 4/7] cli: search: Add --output={sender,recipients}

2014-10-31 Thread Michal Sojka
The new outputs allow printing senders, recipients or both of matching messages. To print both, the user can use --output=sender and --output=recipients simultaneously. Currently, the same address can appear multiple times in the output. The next commit will change this. For this reason, tests

[PATCH v6 7/7] cli: search: Add --filter-by option to configure address filtering

2014-10-31 Thread Michal Sojka
This option allows to configure the criterion for duplicate address filtering. Without this option, all unique combinations of name and address parts are printed. This option allows to filter the output more, for example to only contain unique address parts. --- completion/notmuch-completion.bash

[PATCH v6 5/7] cli: search: Do not output duplicate addresses

2014-10-31 Thread Michal Sojka
This filters out duplicate addresses from address outputs (sender, receivers). It also also adds tests for the new outputs. The code here is an extended version of a patch from Jani Nikula. --- doc/man1/notmuch-search.rst | 2 ++ notmuch-search.c| 51 ++

[PATCH v6 6/7] cli: search: Add --output=count

2014-10-31 Thread Michal Sojka
This output can be used with --output=recipients or --output=sender and in addition to the addresses, it prints how many times was each address encountered during search. --- completion/notmuch-completion.bash | 2 +- completion/notmuch-completion.zsh | 2 +- doc/man1/notmuch-search.rst

[PATCH v6 2/7] cli: Add support for parsing keyword-flag arguments

2014-10-31 Thread Michal Sojka
From: Jani Nikula j...@nikula.org This allows having multiple --foo=bar --foo=baz options on the command line, with the corresponding values OR'd together. [Test added by Michal Sojka] --- command-line-arguments.c | 6 +- command-line-arguments.h | 1 + test/T410-argument

[PATCH v4 5/6] cli: search: Add configurable way to filter out duplicate addresses

2014-10-30 Thread Michal Sojka
On Thu, Oct 30 2014, Tomi Ollila wrote: > On Thu, Oct 30 2014, Mark Walters wrote: > >> On Mon, 27 Oct 2014, Michal Sojka wrote: >>> This adds an algorithm to filter out duplicate addresses from address >>> outputs (sender, receivers). The algorithm can be configure

[PATCH v4 5/6] cli: search: Add configurable way to filter out duplicate addresses

2014-10-30 Thread Michal Sojka
On Thu, Oct 30 2014, Mark Walters wrote: > On Mon, 27 Oct 2014, Michal Sojka wrote: >> This adds an algorithm to filter out duplicate addresses from address >> outputs (sender, receivers). The algorithm can be configured with >> --filter-by command line option. >> >

[PATCH v4 1/6] cli: search: Refactor passing of command line options

2014-10-30 Thread Michal Sojka
Hi Mark, On Thu, Oct 30 2014, Mark Walters wrote: > Hi > > On Mon, 27 Oct 2014, Michal Sojka wrote: >> Many functions that implement the search command need to access command >> line options. Instead of passing each option in a separate variable, put >> them i

Re: [PATCH v4 1/6] cli: search: Refactor passing of command line options

2014-10-30 Thread Michal Sojka
Hi Mark, On Thu, Oct 30 2014, Mark Walters wrote: Hi On Mon, 27 Oct 2014, Michal Sojka sojk...@fel.cvut.cz wrote: Many functions that implement the search command need to access command line options. Instead of passing each option in a separate variable, put them in a structure and pass

Re: [PATCH v4 5/6] cli: search: Add configurable way to filter out duplicate addresses

2014-10-30 Thread Michal Sojka
On Thu, Oct 30 2014, Mark Walters wrote: On Mon, 27 Oct 2014, Michal Sojka sojk...@fel.cvut.cz wrote: This adds an algorithm to filter out duplicate addresses from address outputs (sender, receivers). The algorithm can be configured with --filter-by command line option. The code here

Re: [PATCH v4 5/6] cli: search: Add configurable way to filter out duplicate addresses

2014-10-30 Thread Michal Sojka
On Thu, Oct 30 2014, Tomi Ollila wrote: On Thu, Oct 30 2014, Mark Walters markwalters1...@gmail.com wrote: On Mon, 27 Oct 2014, Michal Sojka sojk...@fel.cvut.cz wrote: This adds an algorithm to filter out duplicate addresses from address outputs (sender, receivers). The algorithm can

[PATCH v5 0/7] notmuch search --output=sender/recipients

2014-10-30 Thread Michal Sojka
: Add support for parsing keyword-flag arguments Michal Sojka (6): cli: search: Refactor passing of command line options cli: search: Convert --output to keyword-flag argument cli: search: Add --output={sender,recipients} cli: search: Do not output duplicate addresses cli: search: Add

[PATCH v5 1/7] cli: search: Refactor passing of command line options

2014-10-30 Thread Michal Sojka
Many functions that implement the search command need to access command line options. Instead of passing each option in a separate variable, put them in a structure and pass only this structure. This will become handy in the following commits. --- notmuch-search.c | 125

[PATCH v5 2/7] cli: Add support for parsing keyword-flag arguments

2014-10-30 Thread Michal Sojka
From: Jani Nikula j...@nikula.org This allows having multiple --foo=bar --foo=baz options on the command line, with the corresponding values OR'd together. [Test added by Michal Sojka] --- command-line-arguments.c | 6 +- command-line-arguments.h | 1 + test/T410-argument

[PATCH v5 3/7] cli: search: Convert --output to keyword-flag argument

2014-10-30 Thread Michal Sojka
This converts notmuch search to use the recently introduced keyword-flag argument parser. At this point, it only makes the code slightly less readable but following commits that add new --output keywords will profit from this. --- notmuch-search.c | 35 ++- 1 file

[PATCH v5 4/7] cli: search: Add --output={sender,recipients}

2014-10-30 Thread Michal Sojka
The new outputs allow printing senders, recipients or both of matching messages. To print both, the user can use --output=sender and --output=recipients simultaneously. Currently, the same address can appear multiple times in the output. The next commit will change this. For this reason, tests

[PATCH v5 6/7] cli: search: Add --output=count

2014-10-30 Thread Michal Sojka
This output can be used with --output=recipients or --output=sender and in addition to the addresses, it prints how many times was each address encountered during search. --- completion/notmuch-completion.bash | 2 +- completion/notmuch-completion.zsh | 2 +- doc/man1/notmuch-search.rst

[PATCH v5 7/7] cli: search: Add --filter-by option to configure address filtering

2014-10-30 Thread Michal Sojka
This option allows to configure the criterion for duplicate address filtering. Without this option, all unique combinations of name and address parts are printed. This option allows to filter the output more, for example to only contain unique address parts. --- completion/notmuch-completion.bash

[PATCH v5 5/7] cli: search: Do not output duplicate addresses

2014-10-30 Thread Michal Sojka
This filters out duplicate addresses from address outputs (sender, receivers). It also also adds tests for the new outputs. The code here is an extended version of a patch from Jani Nikula. --- doc/man1/notmuch-search.rst | 2 ++ notmuch-search.c| 51 ++

[PATCH v4 6/6] cli: search: Add --output=count

2014-10-27 Thread Michal Sojka
This output can be used with --output=recipients or --output=sender and in addition to the mailboxes, it prints how many times was each mailbox encountered during search. --- completion/notmuch-completion.bash | 2 +- completion/notmuch-completion.zsh | 2 +- doc/man1/notmuch-search.rst

[PATCH v4 5/6] cli: search: Add configurable way to filter out duplicate addresses

2014-10-27 Thread Michal Sojka
This adds an algorithm to filter out duplicate addresses from address outputs (sender, receivers). The algorithm can be configured with --filter-by command line option. The code here is an extended version of a patch from Jani Nikula. --- completion/notmuch-completion.bash | 6 ++-

[PATCH v4 4/6] cli: search: Add --output={sender,recipients}

2014-10-27 Thread Michal Sojka
The new outputs allow printing senders, recipients or both of matching messages. To print both, the user can use --output=sender and --output=recipients simultaneously. Currently, the same address can appear multiple times in the output. The next patch will change this. For this reason, the test

[PATCH v4 3/6] cli: search: Convert --output to keyword-flag argument

2014-10-27 Thread Michal Sojka
This converts "notmuch search" to use the recently introduced keyword-flag argument parser. At this point, it only makes the code slightly less readable but following patches that add new --output keywords will profit from this. --- notmuch-search.c | 35 ++- 1

[PATCH v4 2/6] cli: Add support for parsing keyword-flag arguments

2014-10-27 Thread Michal Sojka
From: Jani Nikula <j...@nikula.org> This allows having multiple --foo=bar --foo=baz options on the command line, with the corresponding values OR'd together. [Test added by Michal Sojka] --- command-line-arguments.c | 6 +- command-line-arguments.h | 1 + test/T410-ar

[PATCH v4 1/6] cli: search: Refactor passing of command line options

2014-10-27 Thread Michal Sojka
Many functions that implement the search command need to access command line options. Instead of passing each option in a separate variable, put them in a structure and pass only this structure. This will become handy in the following patches. --- notmuch-search.c | 125

[PATCH v4 0/6] notmuch search --output=sender/recipients

2014-10-27 Thread Michal Sojka
- There is no way to output unfiltered (duplicite) addresses. Hopefully, the introduction of --output=count is sufficient replacement for this "feature". Cheers, -Michal Jani Nikula (1): cli: Add support for parsing keyword-flag arguments Michal Sojka (5): cli: search: Refactor passing

[PATCH v4 6/6] cli: search: Add --output=count

2014-10-27 Thread Michal Sojka
This output can be used with --output=recipients or --output=sender and in addition to the mailboxes, it prints how many times was each mailbox encountered during search. --- completion/notmuch-completion.bash | 2 +- completion/notmuch-completion.zsh | 2 +- doc/man1/notmuch-search.rst

[PATCH v4 0/6] notmuch search --output=sender/recipients

2014-10-27 Thread Michal Sojka
- There is no way to output unfiltered (duplicite) addresses. Hopefully, the introduction of --output=count is sufficient replacement for this feature. Cheers, -Michal Jani Nikula (1): cli: Add support for parsing keyword-flag arguments Michal Sojka (5): cli: search: Refactor passing of command line

[PATCH v4 4/6] cli: search: Add --output={sender,recipients}

2014-10-27 Thread Michal Sojka
The new outputs allow printing senders, recipients or both of matching messages. To print both, the user can use --output=sender and --output=recipients simultaneously. Currently, the same address can appear multiple times in the output. The next patch will change this. For this reason, the test

[PATCH v4 1/6] cli: search: Refactor passing of command line options

2014-10-27 Thread Michal Sojka
Many functions that implement the search command need to access command line options. Instead of passing each option in a separate variable, put them in a structure and pass only this structure. This will become handy in the following patches. --- notmuch-search.c | 125

[PATCH v4 3/6] cli: search: Convert --output to keyword-flag argument

2014-10-27 Thread Michal Sojka
This converts notmuch search to use the recently introduced keyword-flag argument parser. At this point, it only makes the code slightly less readable but following patches that add new --output keywords will profit from this. --- notmuch-search.c | 35 ++- 1 file

[PATCH v4 2/6] cli: Add support for parsing keyword-flag arguments

2014-10-27 Thread Michal Sojka
From: Jani Nikula j...@nikula.org This allows having multiple --foo=bar --foo=baz options on the command line, with the corresponding values OR'd together. [Test added by Michal Sojka] --- command-line-arguments.c | 6 +- command-line-arguments.h | 1 + test/T410-argument

[PATCH v3 3/4] cli: Extend the search command for --output={sender, recipients}

2014-10-24 Thread Michal Sojka
Hi Mark, I mostly agree with your points mentioned in this and other your emails. I'll prepare v4 based on that. On Wed, Oct 22 2014, Mark Walters wrote: > On Sun, 12 Oct 2014, Michal Sojka wrote: >> The new outputs allow printing senders, recipients or both of matching &g

Re: [PATCH v3 3/4] cli: Extend the search command for --output={sender, recipients}

2014-10-24 Thread Michal Sojka
Hi Mark, I mostly agree with your points mentioned in this and other your emails. I'll prepare v4 based on that. On Wed, Oct 22 2014, Mark Walters wrote: On Sun, 12 Oct 2014, Michal Sojka sojk...@fel.cvut.cz wrote: The new outputs allow printing senders, recipients or both of matching

[PATCH v3 3/4] cli: Extend the search command for --output={sender, recipients}

2014-10-14 Thread Michal Sojka
On Mon, Oct 13 2014, Tomi Ollila wrote: > On Mon, Oct 13 2014, Michal Sojka wrote: > >> The new outputs allow printing senders, recipients or both of matching >> messages. The --output option is converted from "keyword" argument to >> "flags" argument

[PATCH v3 4/4] cli: Add an option to filter our duplicate addresses

2014-10-13 Thread Michal Sojka
This adds a --filter-by option to "notmuch search". It can be used to filter out duplicate addresses in --output=sender/receivers. The code here is an extended version of a patch from Jani Nikula. --- completion/notmuch-completion.bash | 6 ++- completion/notmuch-completion.zsh | 3 +-

[PATCH v3 3/4] cli: Extend the search command for --output={sender, recipients}

2014-10-13 Thread Michal Sojka
The new outputs allow printing senders, recipients or both of matching messages. The --output option is converted from "keyword" argument to "flags" argument, which means that the user can use --output=sender and --output=recipients simultaneously, to print both. Other combinations produce an

[PATCH v3 2/4] cli: Add support for parsing multiple keyword arguments

2014-10-13 Thread Michal Sojka
From: Jani Nikula <j...@nikula.org> This allows having multiple --foo=bar --foo=baz options on the command line, with the corresponding values OR'd together. [Test added by Michal Sojka] --- command-line-arguments.c | 6 +- command-line-arguments.h | 1 + test/T410-ar

[PATCH v3 1/4] cli: Refactor option passing in the search command

2014-10-13 Thread Michal Sojka
Many functions that implement the search command need to access command line options. Instead of passing each option in a separate variable, put them in a structure and pass only this structure. This will become handy in the following patches. --- notmuch-search.c | 122

[PATCH v3 0/4] notmuch search --output=sender/recipients

2014-10-13 Thread Michal Sojka
dd support for parsing multiple keyword arguments Michal Sojka (3): cli: Refactor option passing in the search command cli: Extend the search command for --output={sender,recipients} cli: Add an option to filter our duplicate addresses command-line-arguments.c | 6 +- command-line-a

[PATCH v3 0/4] notmuch search --output=sender/recipients

2014-10-12 Thread Michal Sojka
multiple keyword arguments Michal Sojka (3): cli: Refactor option passing in the search command cli: Extend the search command for --output={sender,recipients} cli: Add an option to filter our duplicate addresses command-line-arguments.c | 6 +- command-line-arguments.h

[PATCH v3 2/4] cli: Add support for parsing multiple keyword arguments

2014-10-12 Thread Michal Sojka
From: Jani Nikula j...@nikula.org This allows having multiple --foo=bar --foo=baz options on the command line, with the corresponding values OR'd together. [Test added by Michal Sojka] --- command-line-arguments.c | 6 +- command-line-arguments.h | 1 + test/T410-argument

[PATCH v3 1/4] cli: Refactor option passing in the search command

2014-10-12 Thread Michal Sojka
Many functions that implement the search command need to access command line options. Instead of passing each option in a separate variable, put them in a structure and pass only this structure. This will become handy in the following patches. --- notmuch-search.c | 122

[PATCH v3 4/4] cli: Add an option to filter our duplicate addresses

2014-10-12 Thread Michal Sojka
This adds a --filter-by option to notmuch search. It can be used to filter out duplicate addresses in --output=sender/receivers. The code here is an extended version of a patch from Jani Nikula. --- completion/notmuch-completion.bash | 6 ++- completion/notmuch-completion.zsh | 3 +-

[PATCH v3 3/4] cli: Extend the search command for --output={sender, recipients}

2014-10-12 Thread Michal Sojka
The new outputs allow printing senders, recipients or both of matching messages. The --output option is converted from keyword argument to flags argument, which means that the user can use --output=sender and --output=recipients simultaneously, to print both. Other combinations produce an error.

<    1   2   3   4   5   6   7   8   9   >