1 /* Create an empty notmuch database with a specific version and
12 main (int argc, char **argv)
15 fprintf (stderr, "Usage: %s mailpath version features\n", argv[0]);
19 std::string nmpath (argv[1]);
21 nmpath += "/.notmuch";
22 if (mkdir (nmpath.c_str (), 0777) < 0) {
23 perror (("failed to create " + nmpath).c_str ());
28 Xapian::WritableDatabase db (
29 nmpath + "/xapian", Xapian::DB_CREATE_OR_OPEN);
30 db.set_metadata ("version", argv[2]);
31 db.set_metadata ("features", argv[3]);
33 } catch (const Xapian::Error &e) {
34 fprintf (stderr, "%s\n", e.get_description ().c_str ());