about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2016-07-31 17:05:20 +0200
committerDuncaen <mail@duncano.de>2017-01-20 23:31:17 +0100
commit0344e5a425afc11e988101156722a0e47722a1af (patch)
tree795f21c7475147e345a9f54b11f1f0f24f66189d
parentafdfd07fe459aa50a6194355ed8984b6cee4a1ee (diff)
downloadmblaze-0344e5a425afc11e988101156722a0e47722a1af.tar.gz
mblaze-0344e5a425afc11e988101156722a0e47722a1af.tar.xz
mblaze-0344e5a425afc11e988101156722a0e47722a1af.zip
mpick: add kept expression
-rw-r--r--man/mpick.12
-rw-r--r--mpick.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/man/mpick.1 b/man/mpick.1
index 2ac7911..cbf2ad1 100644
--- a/man/mpick.1
+++ b/man/mpick.1
@@ -101,7 +101,7 @@ tests are given by the following EBNF:
 
 <timeprop> ::= atime | ctime | mtime | date
 
-<numprop>  ::= depth | replies | index | size | total
+<numprop>  ::= depth | kept | replies | index | size | total
 
 <numop>    ::= <= | < | >= | > | == | = | !=
 
diff --git a/mpick.c b/mpick.c
index ba70951..25c797e 100644
--- a/mpick.c
+++ b/mpick.c
@@ -60,6 +60,7 @@ enum prop {
 	PROP_ATIME = 1,
 	PROP_CTIME,
 	PROP_DEPTH,
+	PROP_KEPT,
 	PROP_MTIME,
 	PROP_PATH,
 	PROP_REPLIES,
@@ -460,6 +461,8 @@ parse_cmp()
 
 	if (token("depth"))
 		prop = PROP_DEPTH;
+	else if (token("kept"))
+		prop = PROP_KEPT;
 	else if (token("index"))
 		prop = PROP_INDEX;
 	else if (token("replies")) {
@@ -827,6 +830,7 @@ eval(struct expr *e, struct mailinfo *m)
 		case PROP_ATIME: v = m->sb->st_atime; break;
 		case PROP_CTIME: v = m->sb->st_ctime; break;
 		case PROP_MTIME: v = m->sb->st_mtime; break;
+		case PROP_KEPT: v = kept; break;
 		case PROP_REPLIES: v = m->replies; break;
 		case PROP_SIZE: v = m->sb->st_size; break;
 		case PROP_DATE: v = msg_date(m); break;