Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 28 / 3b17f96ed19f1af18ed7f73255cd896873350f
1 Return-Path: <jani@nikula.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 08154429E21\r
6         for <notmuch@notmuchmail.org>; Sun, 13 Nov 2011 14:47:36 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: -0.7\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
13         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id ybjKceXU+GKr for <notmuch@notmuchmail.org>;\r
17         Sun, 13 Nov 2011 14:47:35 -0800 (PST)\r
18 Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
19         [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 4278D431FB6\r
22         for <notmuch@notmuchmail.org>; Sun, 13 Nov 2011 14:47:35 -0800 (PST)\r
23 Received: by mail-bw0-f53.google.com with SMTP id q10so6354254bka.26\r
24         for <notmuch@notmuchmail.org>; Sun, 13 Nov 2011 14:47:34 -0800 (PST)\r
25 Received: by 10.205.138.140 with SMTP id is12mr8846828bkc.139.1321224454791;\r
26         Sun, 13 Nov 2011 14:47:34 -0800 (PST)\r
27 Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi.\r
28         [80.220.92.23])\r
29         by mx.google.com with ESMTPS id q6sm28076066bka.6.2011.11.13.14.47.32\r
30         (version=SSLv3 cipher=OTHER); Sun, 13 Nov 2011 14:47:33 -0800 (PST)\r
31 From: Jani Nikula <jani@nikula.org>\r
32 To: notmuch@notmuchmail.org,\r
33         david@tethera.net\r
34 Subject: [PATCH 1/6] cli: notmuch new: use getopt_long for parsing command\r
35         line options\r
36 Date: Mon, 14 Nov 2011 00:47:21 +0200\r
37 Message-Id:\r
38  <828501bd94ae962dda51fd470cb248921e1c6b79.1321223343.git.jani@nikula.org>\r
39 X-Mailer: git-send-email 1.7.5.4\r
40 In-Reply-To: <cover.1321223343.git.jani@nikula.org>\r
41 References: <cover.1321223343.git.jani@nikula.org>\r
42 In-Reply-To: <cover.1321223343.git.jani@nikula.org>\r
43 References: <cover.1321223343.git.jani@nikula.org>\r
44 X-BeenThere: notmuch@notmuchmail.org\r
45 X-Mailman-Version: 2.1.13\r
46 Precedence: list\r
47 List-Id: "Use and development of the notmuch mail system."\r
48         <notmuch.notmuchmail.org>\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
52 List-Post: <mailto:notmuch@notmuchmail.org>\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
56 X-List-Received-Date: Sun, 13 Nov 2011 22:47:36 -0000\r
57 \r
58 Signed-off-by: Jani Nikula <jani@nikula.org>\r
59 ---\r
60  notmuch-client.h |    1 +\r
61  notmuch-new.c    |   20 +++++++++++++++-----\r
62  2 files changed, 16 insertions(+), 5 deletions(-)\r
63 \r
64 diff --git a/notmuch-client.h b/notmuch-client.h\r
65 index b50cb38..eb16f0d 100644\r
66 --- a/notmuch-client.h\r
67 +++ b/notmuch-client.h\r
68 @@ -43,6 +43,7 @@\r
69  #include <sys/stat.h>\r
70  #include <sys/time.h>\r
71  #include <unistd.h>\r
72 +#include <getopt.h>\r
73  #include <dirent.h>\r
74  #include <errno.h>\r
75  #include <signal.h>\r
76 diff --git a/notmuch-new.c b/notmuch-new.c\r
77 index 81a9350..145aa64 100644\r
78 --- a/notmuch-new.c\r
79 +++ b/notmuch-new.c\r
80 @@ -815,16 +815,26 @@ notmuch_new_command (void *ctx, int argc, char *argv[])\r
81      add_files_state.verbose = 0;\r
82      add_files_state.output_is_a_tty = isatty (fileno (stdout));\r
83  \r
84 -    argc--; argv++; /* skip subcommand argument */\r
85 +    while (1) {\r
86 +       int opt;\r
87 +       static struct option options[] = {\r
88 +           { "verbose", no_argument, NULL, 0 },\r
89 +           { NULL, 0, NULL, 0 },\r
90 +       };\r
91 +\r
92 +       opt = getopt_long (argc, argv, "", options, NULL);\r
93 +       if (opt == -1)\r
94 +           break;\r
95  \r
96 -    for (i = 0; i < argc && argv[i][0] == '-'; i++) {\r
97 -       if (STRNCMP_LITERAL (argv[i], "--verbose") == 0) {\r
98 +       switch (opt) {\r
99 +       case 0:\r
100             add_files_state.verbose = 1;\r
101 -       } else {\r
102 -           fprintf (stderr, "Unrecognized option: %s\n", argv[i]);\r
103 +           break;\r
104 +       case '?':\r
105             return 1;\r
106         }\r
107      }\r
108 +\r
109      config = notmuch_config_open (ctx, NULL, NULL);\r
110      if (config == NULL)\r
111         return 1;\r
112 -- \r
113 1.7.5.4\r
114 \r