Commit graph

4 commits

Author SHA1 Message Date
Austin Clements
e0a223d156 tag: Disallow adding malformed tags to messages
This disallows adding empty tags, since nothing but confusion follows
in their wake, and disallows adding tags that begin with "-" because
they are also confusing, the tag "-" is impossible to remove using the
CLI, and because the syntax for removing such tags conflicts with long
argument syntax.

This does not place any restrictions on what tags can be removed, as
that would make it difficult for people who have the misfortune of
already having malformed tags to remove these tags.
2012-10-27 09:32:44 -03:00
Jani Nikula
8e3ff8fb03 cli: refactor "notmuch tag" data structures for tagging operations
To simplify code, keep all tagging operations in a single array
instead of separate add and remove arrays. Apply tag changes in the
order specified on the command line, instead of first removing and
then adding the tags.

This results in a minor functional change: If a tag is both added and
removed, the last specified operation is now used. Previously the tag
was always added. Change the relevant test to reflect the new
behaviour.

Signed-off-by: Jani Nikula <jani@nikula.org>
2012-03-30 21:20:36 -03:00
Jani Nikula
918b803597 test: add test for both adding and removing a tag at the same time
The current behaviour is that regardless of the order in which the
addition and removal of a tag are specified, the tag is added.

Signed-off-by: Jani Nikula <jani@nikula.org>
2012-03-30 21:20:21 -03:00
Austin Clements
ed20210b6d test: Add a test script for "notmuch tag" 2011-11-14 21:21:22 -04:00