]> git.notmuchmail.org Git - notmuch/blob - notmuch.c
Migrate to goconfig pkg
[notmuch] / notmuch.c
1 /* notmuch - Not much of an email program, (just index and search)
2  *
3  * Copyright © 2009 Carl Worth
4  * Copyright © 2009 Keith Packard
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see http://www.gnu.org/licenses/ .
18  *
19  * Authors: Carl Worth <cworth@cworth.org>
20  *          Keith Packard <keithp@keithp.com>
21  */
22
23 #include "notmuch-client.h"
24
25 typedef int (*command_function_t) (void *ctx, int argc, char *argv[]);
26
27 typedef struct command {
28     const char *name;
29     command_function_t function;
30     const char *arguments;
31     const char *summary;
32     const char *documentation;
33 } command_t;
34
35 static int
36 notmuch_help_command (void *ctx, int argc, char *argv[]);
37
38 static const char search_terms_help[] =
39     "\tSeveral notmuch commands accept a comman syntax for search\n"
40     "\tterms.\n"
41     "\n"
42     "\tThe search terms can consist of free-form text (and quoted\n"
43     "\tphrases) which will match all messages that contain all of\n"
44     "\tthe given terms/phrases in the body, the subject, or any of\n"
45     "\tthe sender or recipient headers.\n"
46     "\n"
47     "\tAs a special case, a search string consisting of exactly a\n"
48     "\tsingle asterisk (\"*\") will match all messages.\n"
49     "\n"
50     "\tIn addition to free text, the following prefixes can be used\n"
51     "\tto force terms to match against specific portions of an email,\n"
52     "\t(where <brackets> indicate user-supplied values):\n"
53     "\n"
54     "\t\tfrom:<name-or-address>\n"
55     "\t\tto:<name-or-address>\n"
56     "\t\tsubject:<word-or-quoted-phrase>\n"
57     "\t\tattachment:<word>\n"
58     "\t\ttag:<tag> (or is:<tag>)\n"
59     "\t\tid:<message-id>\n"
60     "\t\tthread:<thread-id>\n"
61     "\t\tfolder:<directory-path>\n"
62     "\n"
63     "\tThe from: prefix is used to match the name or address of\n"
64     "\tthe sender of an email message.\n"
65     "\n"
66     "\tThe to: prefix is used to match the names or addresses of\n"
67     "\tany recipient of an email message, (whether To, Cc, or Bcc).\n"
68     "\n"
69     "\tAny term prefixed with subject: will match only text from\n"
70     "\tthe subject of an email. Quoted phrases are supported when\n"
71     "\tsearching with: subject:\"this is a phrase\".\n"
72     "\n"
73     "\tFor tag: and is:, valid tag values include \"inbox\" and \"unread\"\n"
74     "\tby default for new messages added by \"notmuch new\" as well\n"
75     "\tas any other tag values added manually with \"notmuch tag\".\n"
76     "\n"
77     "\tFor id:, message ID values are the literal contents of the\n"
78     "\tMessage-ID: header of email messages, but without the '<','>'\n"
79     "\tdelimiters.\n"
80     "\n"
81     "\tThe thread: prefix can be used with the thread ID values that\n"
82     "\tare generated internally by notmuch (and do not appear in email\n"
83     "\tmessages). These thread ID values can be seen in the first\n"
84     "\tcolumn of output from \"notmuch search\".\n"
85     "\n"
86     "\tThe folder: prefix can be used to search for email message\n"
87     "\tfiles that are contained within particular directories within\n"
88     "\tthe mail store. Only the directory components below the top-level\n"
89     "\tmail database path are available to be searched.\n"
90     "\n"
91     "\tIn addition to individual terms, multiple terms can be\n"
92     "\tcombined with Boolean operators (\"and\", \"or\", \"not\", etc.).\n"
93     "\tEach term in the query will be implicitly connected by a\n"
94     "\tlogical AND if no explicit operator is provided, (except\n"
95     "\tthat terms with a common prefix will be implicitly combined\n"
96     "\twith OR until we get Xapian defect #402 fixed).\n"
97     "\n"
98     "\tParentheses can also be used to control the combination of\n"
99     "\tthe Boolean operators, but will have to be protected from\n"
100     "\tinterpretation by the shell, (such as by putting quotation\n"
101     "\tmarks around any parenthesized expression).\n"
102     "\n"
103     "\tFinally, results can be restricted to only messages within a\n"
104     "\tparticular time range, (based on the Date: header) with:\n"
105     "\n"
106     "\t\t<intial-timestamp>..<final-timestamp>\n"
107     "\n"
108     "\tEach timestamp is a number representing the number of seconds\n"
109     "\tsince 1970-01-01 00:00:00 UTC. This is not the most convenient\n"
110     "\tmeans of expressing date ranges, but until notmuch is fixed to\n"
111     "\taccept a more convenient form, one can use the date program to\n"
112     "\tconstruct timestamps. For example, with the bash shell the\n"
113     "\tfollowing syntax would specify a date range to return messages\n"
114     "\tfrom 2009-10-01 until the current time:\n"
115     "\n"
116     "\t\t$(date +%%s -d 2009-10-01)..$(date +%%s)\n\n";
117
118 command_t commands[] = {
119     { "setup", notmuch_setup_command,
120       NULL,
121       "Interactively setup notmuch for first use.",
122       "\tThe setup command will prompt for your full name, your primary\n"
123       "\temail address, any alternate email addresses you use, and the\n"
124       "\tdirectory containing your email archives. Your answers will be\n"
125       "\twritten to a configuration file in ${NOTMUCH_CONFIG} (if set)\n"
126       "\tor ${HOME}/.notmuch-config.\n"
127       "\n"
128       "\tThis configuration file will be created with descriptive\n"
129       "\tcomments, making it easy to edit by hand later to change the\n"
130       "\tconfiguration. Or you can run \"notmuch setup\" again.\n"
131       "\n"
132       "\tInvoking notmuch with no command argument will run setup if\n"
133       "\tthe setup command has not previously been completed." },
134     { "new", notmuch_new_command,
135       "[--verbose]",
136       "Find and import new messages to the notmuch database.",
137       "\tScans all sub-directories of the mail directory, performing\n"
138       "\tfull-text indexing on new messages that are found. Each new\n"
139       "\tmessage will be tagged as both \"inbox\" and \"unread\".\n"
140       "\n"
141       "\tYou should run \"notmuch new\" once after first running\n"
142       "\t\"notmuch setup\" to create the initial database. The first\n"
143       "\trun may take a long time if you have a significant amount of\n"
144       "\tmail (several hundred thousand messages or more).\n"
145       "\n"
146       "\tSubsequently, you should run \"notmuch new\" whenever new mail\n"
147       "\tis delivered and you wish to incorporate it into the database.\n"
148       "\tThese subsequent runs will be much quicker than the initial run.\n"
149       "\n"
150       "\tSupported options for new include:\n"
151       "\n"
152       "\t--verbose\n"
153       "\n"
154       "\t\tVerbose operation. Shows paths of message files as\n"
155       "\t\tthey are being indexed.\n"
156       "\n"
157       "\tInvoking notmuch with no command argument will run new if\n"
158       "\tthe setup command has previously been completed, but new has\n"
159       "\tnot previously been run." },
160     { "search", notmuch_search_command,
161       "[options...] <search-terms> [...]",
162       "Search for messages matching the given search terms.",
163       "\tNote that the individual mail messages will be matched\n"
164       "\tagainst the search terms, but the results will be the\n"
165       "\tthreads (one per line) containing the matched messages.\n"
166       "\n"
167       "\tSupported options for search include:\n"
168       "\n"
169       "\t--format=(json|text)\n"
170       "\n"
171       "\t\tPresents the results in either JSON or\n"
172       "\t\tplain-text (default)\n"
173       "\n"
174       "\t--output=(summary|threads|messages|files|tags)\n"
175       "\n"
176       "\t\tsummary (default)\n"
177       "\n"
178       "\t\tOutput a summary of each thread with any message matching the\n"
179       "\t\tsearch terms. The summary includes the thread ID, date, the\n"
180       "\t\tnumber of messages in the thread (both the number matched and\n"
181       "\t\tthe total number), the authors of the thread and the subject.\n"
182       "\n"
183       "\t\tthreads\n"
184       "\n"
185       "\t\tOutput the thread IDs of all threads with any message matching\n"
186       "\t\tthe search terms, either one per line (--format=text) or as a\n"
187       "\t\tJSON array (--format=json).\n"
188       "\n"
189       "\t\tmessages\n"
190       "\n"
191       "\t\tOutput the message IDs of all messages matching the search\n"
192       "\t\tterms, either one per line (--format=text) or as a JSON array\n"
193       "\t\t(--format=json).\n"
194       "\n"
195       "\t\tfiles\n"
196       "\n"
197       "\t\tOutput the filenames of all messages matching the search\n"
198       "\t\tterms, either one per line (--format=text) or as a JSON array\n"
199       "\t\t(--format=json).\n"
200       "\n"
201       "\t\ttags\n"
202       "\n"
203       "\t\tOutput all tags that appear on any message matching the search\n"
204       "\t\tterms, either one per line (--format=text) or as a JSON array\n"
205       "\t\t(--format=json).\n"
206       "\n"
207       "\t--sort=(newest-first|oldest-first)\n"
208       "\n"
209       "\t\tPresent results in either chronological order\n"
210       "\t\t(oldest-first) or reverse chronological order\n"
211       "\t\t(newest-first), which is the default.\n"
212       "\n"
213       "\tSee \"notmuch help search-terms\" for details of the search\n"
214       "\tterms syntax." },
215     { "show", notmuch_show_command,
216       "<search-terms> [...]",
217       "Show all messages matching the search terms.",
218       "\tThe messages are grouped and sorted based on the threading\n"
219       "\t(all replies to a particular message appear immediately\n"
220       "\tafter that message in date order).\n"
221       "\n"
222       "\tSupported options for show include:\n"
223       "\n"
224       "\t--entire-thread\n"
225       "\n"
226       "\t\tBy default only those messages that match the\n"
227       "\t\tsearch terms will be displayed. With this option,\n"
228       "\t\tall messages in the same thread as any matched\n"
229       "\t\tmessage will be displayed.\n"
230       "\n"
231       "\t--format=(text|json|mbox|raw)\n"
232       "\n"
233       "\t\ttext (default)\n"
234       "\n"
235       "\t\tThe default plain-text format has all text-content MIME parts\n"
236       "\t\tdecoded. Various components in the output, ('message', 'header',\n"
237       "\t\t'body', 'attachment', and MIME 'part') are delimited by\n"
238       "\t\teasily-parsed markers. Each marker consists of a Control-L\n"
239       "\t\tcharacter (ASCII decimal 12), the name of the marker, and\n"
240       "\t\tthen either an opening or closing brace, '{' or '}' to\n"
241       "\t\teither open or close the component.\n"
242       "\n"
243       "\t\tjson\n"
244       "\n"
245       "\t\tThe output is formatted with Javascript Object Notation\n"
246       "\t\t(JSON). This format is more robust than the text format\n"
247       "\t\tfor automated processing. JSON output always includes all\n"
248       "\t\tmessages in a matching thread; in effect '--format=json'\n"
249       "\t\timplies '--entire-thread'\n"
250       "\n"
251       "\t\tmbox\n"
252       "\n"
253       "\t\tAll matching messages are output in the traditional, Unix\n"
254       "\t\tmbox format with each message being prefixed by a line\n"
255       "\t\tbeginning with 'From ' and a blank line separating each\n"
256       "\t\tmessage. Lines in the message content beginning with 'From '\n"
257       "\t\t(preceded by zero or more '>' characters) have an additional\n"
258       "\t\t'>' character added. This reversible escaping is termed\n"
259       "\t\t\"mboxrd\" format and described in detail here:\n"
260       "\n"
261       "\t\thttp://homepage.ntlworld.com/jonathan.deboynepollard/FGA/mail-mbox-formats.html\n"
262       "\n"
263       "\t\traw\n"
264       "\n"
265       "\t\tThe original, raw content of the email message is displayed.\n"
266       "\t\tConsumers of this format should expect to implement MIME\n"
267       "\t\tdecoding and similar functions. This format must only\n"
268       "\t\tbe used with search terms matching a single message.\n"
269       "\n"
270       "\tA common use of \"notmuch show\" is to display a single\n"
271       "\tthread of email messages. For this, use a search term of\n"
272       "\t\"thread:<thread-id>\" as can be seen in the first column\n"
273       "\tof output from the \"notmuch search\" command.\n"
274       "\n"
275       "\tSee \"notmuch help search-terms\" for details of the search\n"
276       "\tterms syntax." },
277     { "count", notmuch_count_command,
278       "<search-terms> [...]",
279       "Count messages matching the search terms.",
280       "\tThe number of matching messages is output to stdout.\n"
281       "\n"
282       "\tWith no search terms, a count of all messages in the database\n"
283       "\twill be displayed.\n"
284       "\n"
285       "\tSee \"notmuch help search-terms\" for details of the search\n"
286       "\tterms syntax." },
287     { "reply", notmuch_reply_command,
288       "[options...] <search-terms> [...]",
289       "Construct a reply template for a set of messages.",
290       "\tConstructs a new message as a reply to a set of existing\n"
291       "\tmessages. The Reply-To: header (if any, otherwise From:) is\n"
292       "\tused for the To: address. The To: and Cc: headers are copied,\n"
293       "\tbut not including any of the user's configured addresses.\n"
294       "\n"
295       "\tA suitable subject is constructed. The In-Reply-to: and\n"
296       "\tReferences: headers are set appropriately, and the content\n"
297       "\tof the original messages is quoted and included in the body\n"
298       "\t(unless --format=headers-only is given).\n"
299       "\n"
300       "\tThe resulting message template is output to stdout.\n"
301       "\n"
302       "\tSupported options for reply include:\n"
303       "\n"
304       "\t--format=(default|headers-only)\n"
305       "\n"
306       "\t\tdefault:\n"
307       "\t\t\tIncludes subject and quoted message body.\n"
308       "\n"
309       "\t\theaders-only:\n"
310       "\t\t\tOnly produces In-Reply-To, References, To\n"
311       "\t\t\tCc, and Bcc headers.\n"
312       "\n"
313       "\tSee \"notmuch help search-terms\" for details of the search\n"
314       "\tterms syntax." },
315     { "tag", notmuch_tag_command,
316       "+<tag>|-<tag> [...] [--] <search-terms> [...]",
317       "Add/remove tags for all messages matching the search terms.",
318       "\tThe search terms are handled exactly as in 'search' so one\n"
319       "\tcan use that command first to see what will be modified.\n"
320       "\n"
321       "\tTags prefixed by '+' are added while those prefixed by\n"
322       "\t'-' are removed. For each message, tag removal is performed\n"
323       "\tbefore tag addition.\n"
324       "\n"
325       "\tThe beginning of <search-terms> is recognized by the first\n"
326       "\targument that begins with neither '+' nor '-'. Support for\n"
327       "\tan initial search term beginning with '+' or '-' is provided\n"
328       "\tby allowing the user to specify a \"--\" argument to separate\n"
329       "\tthe tags from the search terms.\n"
330       "\n"
331       "\tSee \"notmuch help search-terms\" for details of the search\n"
332       "\tterms syntax." },
333     { "dump", notmuch_dump_command,
334       "[<filename>]",
335       "Create a plain-text dump of the tags for each message.",
336       "\tOutput is to the given filename, if any, or to stdout.\n"
337       "\tThese tags are the only data in the notmuch database\n"
338       "\tthat can't be recreated from the messages themselves.\n"
339       "\tThe output of notmuch dump is therefore the only\n"
340       "\tcritical thing to backup (and much more friendly to\n"
341       "\tincremental backup than the native database files.)" },
342     { "restore", notmuch_restore_command,
343       "<filename>",
344       "Restore the tags from the given dump file (see 'dump').",
345       "\tNote: The dump file format is specifically chosen to be\n"
346       "\tcompatible with the format of files produced by sup-dump.\n"
347       "\tSo if you've previously been using sup for mail, then the\n"
348       "\t\"notmuch restore\" command provides you a way to import\n"
349       "\tall of your tags (or labels as sup calls them)." },
350     { "search-tags", notmuch_search_tags_command,
351       "[<search-terms> [...] ]",
352       "List all tags found in the database or matching messages.",
353       "\tRun this command without any search-term(s) to obtain a list\n"
354       "\tof all tags found in the database. If you provide one or more\n"
355       "\tsearch-terms as argument(s) then the resulting list will\n"
356       "\tcontain tags only from messages that match the search-term(s).\n"
357       "\n"
358       "\tIn both cases the list will be alphabetically sorted." },
359     { "part", notmuch_part_command,
360       "--part=<num> <search-terms>",
361       "Output a single MIME part of a message.",
362       "\tA single decoded MIME part, with no encoding or framing,\n"
363       "\tis output to stdout. The search terms must match only a single\n"
364       "\tmessage, otherwise this command will fail.\n"
365       "\n"
366       "\tThe part number should match the part \"id\" field output\n"
367       "\tby the \"--format=json\" option of \"notmuch show\". If the\n"
368       "\tmessage specified by the search terms does not include a\n"
369       "\tpart with the specified \"id\" there will be no output." },
370     { "config", notmuch_config_command,
371       "[get|set] <section>.<item> [value ...]",
372       "Get or set settings in the notmuch configuration file.",
373       "    config get <section>.<item>\n"
374       "\n"
375       "\tThe value of the specified configuration item is printed\n"
376       "\tto stdout. If the item has multiple values, each value\n"
377       "\tis separated by a newline character.\n"
378       "\n"
379       "\tAvailable configuration items include at least\n"
380       "\n"
381       "\t\tdatabase.path\n"
382       "\t\tuser.name\n"
383       "\t\tuser.primary_email\n"
384       "\t\tuser.other_email\n"
385       "\t\tnew.tags\n"
386       "\n"
387       "    config set <section>.<item> [value ...]\n"
388       "\n"
389       "\tThe specified configuration item is set to the given value.\n"
390       "\tTo specify a multiple-value item, provide each value as\n"
391       "\ta separate command-line argument.\n"
392       "\n"
393       "\tIf no values are provided, the specified configuration item\n"
394       "\twill be removed from the configuration file." },
395     { "help", notmuch_help_command,
396       "[<command>]",
397       "This message, or more detailed help for the named command.",
398       "\tExcept in this case, where there's not much more detailed\n"
399       "\thelp available." }
400 };
401
402 static void
403 usage (FILE *out)
404 {
405     command_t *command;
406     unsigned int i;
407
408     fprintf (out,
409              "Usage: notmuch --help\n"
410              "       notmuch --version\n"
411              "       notmuch <command> [args...]\n");
412     fprintf (out, "\n");
413     fprintf (out, "The available commands are as follows:\n");
414     fprintf (out, "\n");
415
416     for (i = 0; i < ARRAY_SIZE (commands); i++) {
417         command = &commands[i];
418
419         fprintf (out, "  %-11s  %s\n",
420                  command->name, command->summary);
421     }
422
423     fprintf (out, "\n");
424     fprintf (out,
425     "Use \"notmuch help <command>\" for more details on each command\n"
426     "and \"notmuch help search-terms\" for the common search-terms syntax.\n\n");
427 }
428
429 static int
430 notmuch_help_command (unused (void *ctx), int argc, char *argv[])
431 {
432     command_t *command;
433     unsigned int i;
434
435     if (argc == 0) {
436         printf ("The notmuch mail system.\n\n");
437         usage (stdout);
438         return 0;
439     }
440
441     for (i = 0; i < ARRAY_SIZE (commands); i++) {
442         command = &commands[i];
443
444         if (strcmp (argv[0], command->name) == 0) {
445             printf ("Help for \"notmuch %s\":\n\n", argv[0]);
446             if (command->arguments)
447                 printf ("%s %s\n\n\t%s\n\n%s\n\n",
448                         command->name, command->arguments,
449                         command->summary, command->documentation);
450             else
451                 printf ("%s\t%s\n\n%s\n\n", command->name,
452                         command->summary, command->documentation);
453             return 0;
454         }
455     }
456
457     if (strcmp (argv[0], "search-terms") == 0) {
458         printf ("Help for <%s>\n\n", argv[0]);
459         for (i = 0; i < ARRAY_SIZE (commands); i++) {
460             command = &commands[i];
461
462             if (command->arguments &&
463                 strstr (command->arguments, "search-terms"))
464             {
465                 printf ("\t%s\t%s\n",
466                         command->name, command->arguments);
467             }
468         }
469         printf ("\n");
470         printf (search_terms_help);
471         return 0;
472     }
473
474     fprintf (stderr,
475              "\nSorry, %s is not a known command. There's not much I can do to help.\n\n",
476              argv[0]);
477     return 1;
478 }
479
480 /* Handle the case of "notmuch" being invoked with no command
481  * argument. For now we just call notmuch_setup_command, but we plan
482  * to be more clever about this in the future.
483  */
484 static int
485 notmuch (void *ctx)
486 {
487     notmuch_config_t *config;
488     notmuch_bool_t is_new;
489     char *db_path;
490     struct stat st;
491
492     config = notmuch_config_open (ctx, NULL, &is_new);
493
494     /* If the user has never configured notmuch, then run
495      * notmuch_setup_command which will give a nice welcome message,
496      * and interactively guide the user through the configuration. */
497     if (is_new) {
498         notmuch_config_close (config);
499         return notmuch_setup_command (ctx, 0, NULL);
500     }
501
502     /* Notmuch is already configured, but is there a database? */
503     db_path = talloc_asprintf (ctx, "%s/%s",
504                                notmuch_config_get_database_path (config),
505                                ".notmuch");
506     if (stat (db_path, &st)) {
507         notmuch_config_close (config);
508         if (errno != ENOENT) {
509             fprintf (stderr, "Error looking for notmuch database at %s: %s\n",
510                      db_path, strerror (errno));
511             return 1;
512         }
513         printf ("Notmuch is configured, but there's not yet a database at\n\n\t%s\n\n",
514                 db_path);
515         printf ("You probably want to run \"notmuch new\" now to create that database.\n\n"
516                 "Note that the first run of \"notmuch new\" can take a very long time\n"
517                 "and that the resulting database will use roughly the same amount of\n"
518                 "storage space as the email being indexed.\n\n");
519         return 0;
520     }
521
522     printf ("Notmuch is configured and appears to have a database. Excellent!\n\n"
523             "At this point you can start exploring the functionality of notmuch by\n"
524             "using commands such as:\n\n"
525             "\tnotmuch search tag:inbox\n\n"
526             "\tnotmuch search to:\"%s\"\n\n"
527             "\tnotmuch search from:\"%s\"\n\n"
528             "\tnotmuch search subject:\"my favorite things\"\n\n"
529             "See \"notmuch help search\" for more details.\n\n"
530             "You can also use \"notmuch show\" with any of the thread IDs resulting\n"
531             "from a search. Finally, you may want to explore using a more sophisticated\n"
532             "interface to notmuch such as the emacs interface implemented in notmuch.el\n"
533             "or any other interface described at http://notmuchmail.org\n\n"
534             "And don't forget to run \"notmuch new\" whenever new mail arrives.\n\n"
535             "Have fun, and may your inbox never have much mail.\n\n",
536             notmuch_config_get_user_name (config),
537             notmuch_config_get_user_primary_email (config));
538
539     notmuch_config_close (config);
540
541     return 0;
542 }
543
544 int
545 main (int argc, char *argv[])
546 {
547     void *local;
548     command_t *command;
549     unsigned int i;
550
551     local = talloc_new (NULL);
552
553     g_mime_init (0);
554
555     if (argc == 1)
556         return notmuch (local);
557
558     if (STRNCMP_LITERAL (argv[1], "--help") == 0)
559         return notmuch_help_command (NULL, 0, NULL);
560
561     if (STRNCMP_LITERAL (argv[1], "--version") == 0) {
562         printf ("notmuch " STRINGIFY(NOTMUCH_VERSION) "\n");
563         return 0;
564     }
565
566     for (i = 0; i < ARRAY_SIZE (commands); i++) {
567         command = &commands[i];
568
569         if (strcmp (argv[1], command->name) == 0)
570             return (command->function) (local, argc - 2, &argv[2]);
571     }
572
573     fprintf (stderr, "Error: Unknown command '%s' (see \"notmuch help\")\n",
574              argv[1]);
575
576     talloc_free (local);
577
578     return 1;
579 }