aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.c
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-11-23 16:58:35 +0100
committerGravatar Carl Worth <cworth@cworth.org>2009-11-23 17:17:08 +0100
commit793cbf80495b8230e0b4de6ac609e2ca88b7dd4b (patch)
tree0847466d390d9ebf5ec63cc5a0c638a096de40d9 /notmuch.c
parenta378dff8a1b9136c3a2472dc6a88911ca3fa41b4 (diff)
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'".
Diffstat (limited to 'notmuch.c')
-rw-r--r--notmuch.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/notmuch.c b/notmuch.c
index 72ca6204..24f87288 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<intial-timestamp>..<final-timestamp>\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,