From 86582ff01b66d1a37c289a07864122d8505522c5 Mon Sep 17 00:00:00 2001 From: Peter Wang Date: Wed, 25 Jul 2012 23:42:30 +1000 Subject: [PATCH] [PATCH 01/18] cli: add stub for insert command --- ab/8048bcbe71435c1e452648165bd458703e5fd8 | 149 ++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 ab/8048bcbe71435c1e452648165bd458703e5fd8 diff --git a/ab/8048bcbe71435c1e452648165bd458703e5fd8 b/ab/8048bcbe71435c1e452648165bd458703e5fd8 new file mode 100644 index 000000000..60fa8381c --- /dev/null +++ b/ab/8048bcbe71435c1e452648165bd458703e5fd8 @@ -0,0 +1,149 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 2483A431FAF + for ; Wed, 25 Jul 2012 06:43:07 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 1NNfBM6iTjWP for ; + Wed, 25 Jul 2012 06:43:06 -0700 (PDT) +Received: from mail-gh0-f181.google.com (mail-gh0-f181.google.com + [209.85.160.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 684CD431FAE + for ; Wed, 25 Jul 2012 06:43:06 -0700 (PDT) +Received: by ghbz13 with SMTP id z13so890675ghb.26 + for ; Wed, 25 Jul 2012 06:43:05 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer:mime-version + :content-type:content-transfer-encoding; + bh=jXneYX2KpAeXbMwDVDGjQyqmb7saJBeJvQFZ/22y9ps=; + b=EiLRqdhRqN0kriOOC1c/yGqBn1OPSwPOevwkPMBy4UWwHxK4gugiv5uNwj6zJjaamw + Q9HxY0VxNZGfglt/FFdTTGiEkR4H1lndOPYnzhoK5jkr9I5tPBr3TQqgHybBvKNbKcMZ + JYGNQhZZkSvf4pDCUfzwYk4+BoXG0Y5XYIh9HhrgF1IQv+w4/E1tBEFb9YeyWah2XAKx + aygcpf01Hp/GL/JgcWWfJoRPRQF3zqJwegxcJpkkCVkrUXXpG1VICfyLIdetCbHi2/vP + R9SywkJiLby3kAdfZANRdQqQKCMUY6zKgeBLIC5dBUVudkGCJ6hd4yQDUsdu2szqVQkm + 2umQ== +Received: by 10.66.83.33 with SMTP id n1mr12805910pay.7.1343223785098; + Wed, 25 Jul 2012 06:43:05 -0700 (PDT) +Received: from localhost (215.42.233.220.static.exetel.com.au. + [220.233.42.215]) + by mx.google.com with ESMTPS id nu5sm14408913pbb.53.2012.07.25.06.43.02 + (version=TLSv1/SSLv3 cipher=OTHER); + Wed, 25 Jul 2012 06:43:04 -0700 (PDT) +From: Peter Wang +To: notmuch@notmuchmail.org +Subject: [PATCH 01/18] cli: add stub for insert command +Date: Wed, 25 Jul 2012 23:42:30 +1000 +Message-Id: <1343223767-9812-1-git-send-email-novalazy@gmail.com> +X-Mailer: git-send-email 1.7.4.4 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 25 Jul 2012 13:43:07 -0000 + +This does nothing yet. +--- + Makefile.local | 1 + + notmuch-client.h | 3 +++ + notmuch-insert.c | 27 +++++++++++++++++++++++++++ + notmuch.c | 3 +++ + 4 files changed, 34 insertions(+), 0 deletions(-) + create mode 100644 notmuch-insert.c + +diff --git a/Makefile.local b/Makefile.local +index 296995d..950f046 100644 +--- a/Makefile.local ++++ b/Makefile.local +@@ -282,6 +282,7 @@ notmuch_client_srcs = \ + notmuch-config.c \ + notmuch-count.c \ + notmuch-dump.c \ ++ notmuch-insert.c \ + notmuch-new.c \ + notmuch-reply.c \ + notmuch-restore.c \ +diff --git a/notmuch-client.h b/notmuch-client.h +index f930798..edbd3ee 100644 +--- a/notmuch-client.h ++++ b/notmuch-client.h +@@ -132,6 +132,9 @@ int + notmuch_dump_command (void *ctx, int argc, char *argv[]); + + int ++notmuch_insert_command (void *ctx, int argc, char *argv[]); ++ ++int + notmuch_new_command (void *ctx, int argc, char *argv[]); + + int +diff --git a/notmuch-insert.c b/notmuch-insert.c +new file mode 100644 +index 0000000..0e061a0 +--- /dev/null ++++ b/notmuch-insert.c +@@ -0,0 +1,27 @@ ++/* notmuch - Not much of an email program, (just index and search) ++ * ++ * Copyright © 2012 Peter Wang ++ * ++ * This program is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see http://www.gnu.org/licenses/ . ++ * ++ * Author: Peter Wang ++ */ ++ ++#include "notmuch-client.h" ++ ++int ++notmuch_insert_command (void *ctx, int argc, char *argv[]) ++{ ++ return 1; ++} +diff --git a/notmuch.c b/notmuch.c +index 477a09c..86239fd 100644 +--- a/notmuch.c ++++ b/notmuch.c +@@ -53,6 +53,9 @@ static command_t commands[] = { + { "new", notmuch_new_command, + "[options...]", + "Find and import new messages to the notmuch database." }, ++ { "insert", notmuch_insert_command, ++ "[options...] [--] [+|- ...] < message", ++ "Add a new message into the maildir and notmuch database." }, + { "search", notmuch_search_command, + "[options...] [...]", + "Search for messages matching the given search terms." }, +-- +1.7.4.4 + -- 2.26.2