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