From 793cbf80495b8230e0b4de6ac609e2ca88b7dd4b Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 23 Nov 2009 16:58:35 +0100 Subject: Add rudimentary date-based search. The rudimentary aspect here is that the date ranges are specified with UNIX timestamp values (number of seconds since 1970-01-01 UTC). One thing that can help here is using the date program to determins timestamps, such as: $(date +%s -d 2009-10-01)..$(date +%s) Long-term, we'll probably need to do our own query parsing to be able to support directly-specified dates and also relative expressions like "since:'2 months ago'". --- notmuch.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'notmuch.c') diff --git a/notmuch.c b/notmuch.c index 72ca620..24f8728 100644 --- a/notmuch.c +++ b/notmuch.c @@ -89,7 +89,22 @@ static const char search_terms_help[] = "\t\tParentheses can also be used to control the combination of\n" "\t\tthe Boolean operators, but will have to be protected from\n" "\t\tinterpretation by the shell, (such as by putting quotation\n" - "\t\tmarks around any parenthesized expression).\n\n"; + "\t\tmarks around any parenthesized expression).\n" + "\n" + "\t\tFinally, results can be restricted to only messages within a\n" + "\t\tparticular time range, (based on the Date: header) with:\n" + "\n" + "\t\t\t..\n" + "\n" + "\t\tEach timestamp is a number representing the number of seconds\n" + "\t\tsince 1970-01-01 00:00:00 UTC. This is not the most convenient\n" + "\t\tmeans of expressing date ranges, but until notmuch is fixed to\n" + "\t\taccept a more convenient form, one can use the date program to\n" + "\t\tconstruct timestamps. For example, with the bash shell the\n" + "\t\tfollowing syntax would specify a date range to return messages\n" + "\t\tfrom 2009-10-01 until the current time:\n" + "\n" + "\t\t\t$(date +%s -d 2009-10-01)..$(date +%s)\n\n"; command_t commands[] = { { "setup", notmuch_setup_command, -- cgit v1.2.3