~sircmpwn/aerc

Change sorting flags v1 PROPOSED

Thanks! I updated your commit message to make sense ;)

To git.sr.ht:~sircmpwn/aerc
   3ec9fd2..043a02d  master -> master
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/aerc/%3C20190920162617.1802580-1-dev%40jeffas.io%3E/mbox | git am -3
Learn more about email & git

[PATCH] Change sorting flags Export this patch

This changes the sorting flags for maildir and imap backends.

They now no longer use -t for searching all text. This seems to make
more sense as being the targeted recipient. I have similarly added Cc
for -c. The text search now resides under -a for all text.
---
 doc/aerc-search.1.scd    | 12 ++++++++++--
 worker/imap/search.go    |  8 ++++++--
 worker/maildir/search.go |  8 ++++++--
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/doc/aerc-search.1.scd b/doc/aerc-search.1.scd
index fae241a..614a2bd 100644
--- a/doc/aerc-search.1.scd
+++ b/doc/aerc-search.1.scd
@@ -12,10 +12,14 @@ aerc-search(1)

 	*-b*: Search in the body of the messages

-	*-t*: Search in the entire text of the messages
+	*-a*: Search in the entire text of the messages

 	*-f <from>*: Search for messages from <from>

+	*-t <to>*: Search for messages to <to>
+
+	*-c <cc>*: Search for messages cc'ed to <cc>
+
 # MAILDIR

 *search* [-rubt] [-f <from>] <terms...>
@@ -28,10 +32,14 @@ aerc-search(1)

 	*-b*: Search in the body of the messages

-	*-t*: Search in the entire text of the messages
+	*-a*: Search in the entire text of the messages

 	*-f <from>*: Search for messages from <from>

+	*-t <to>*: Search for messages to <to>
+
+	*-c <cc>*: Search for messages cc'ed to <cc>
+
 # NOTMUCH

 *search* <query...>
diff --git a/worker/imap/search.go b/worker/imap/search.go
index 939516d..42e155b 100644
--- a/worker/imap/search.go
+++ b/worker/imap/search.go
@@ -9,7 +9,7 @@ import (
 func parseSearch(args []string) (*imap.SearchCriteria, error) {
 	criteria := imap.NewSearchCriteria()

-	opts, optind, err := getopt.Getopts(args, "rubtH:f:")
+	opts, optind, err := getopt.Getopts(args, "rubat:H:f:c:")
 	if err != nil {
 		return nil, err
 	}
@@ -25,9 +25,13 @@ func parseSearch(args []string) (*imap.SearchCriteria, error) {
 			// TODO
 		case 'f':
 			criteria.Header.Add("From", opt.Value)
+		case 't':
+			criteria.Header.Add("To", opt.Value)
+		case 'c':
+			criteria.Header.Add("Cc", opt.Value)
 		case 'b':
 			body = true
-		case 't':
+		case 'a':
 			text = true
 		}
 	}
diff --git a/worker/maildir/search.go b/worker/maildir/search.go
index f8130ac..47eab6a 100644
--- a/worker/maildir/search.go
+++ b/worker/maildir/search.go
@@ -29,7 +29,7 @@ func newSearchCriteria() *searchCriteria {
 func parseSearch(args []string) (*searchCriteria, error) {
 	criteria := newSearchCriteria()

-	opts, optind, err := getopt.Getopts(args, "rubtH:f:")
+	opts, optind, err := getopt.Getopts(args, "rubat:H:f:c:")
 	if err != nil {
 		return nil, err
 	}
@@ -45,9 +45,13 @@ func parseSearch(args []string) (*searchCriteria, error) {
 			// TODO
 		case 'f':
 			criteria.Header.Add("From", opt.Value)
+		case 't':
+			criteria.Header.Add("To", opt.Value)
+		case 'c':
+			criteria.Header.Add("Cc", opt.Value)
 		case 'b':
 			body = true
-		case 't':
+		case 'a':
 			text = true
 		}
 	}
--
2.23.0
Thanks! I updated your commit message to make sense ;)

To git.sr.ht:~sircmpwn/aerc
   3ec9fd2..043a02d  master -> master
View this thread in the archives