From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 934B26DE11A3 for ; Fri, 6 Jan 2017 12:15:07 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Spam-Flag: NO X-Spam-Score: 0.274 X-Spam-Level: X-Spam-Status: No, score=0.274 tagged_above=-999 required=5 tests=[AWL=0.294, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GL2Nnf8oCuK7 for ; Fri, 6 Jan 2017 12:15:07 -0800 (PST) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by arlo.cworth.org (Postfix) with ESMTPS id B63616DE0FA5 for ; Fri, 6 Jan 2017 12:15:00 -0800 (PST) Received: by mail-lf0-f68.google.com with SMTP id q89so749907lfi.1 for ; Fri, 06 Jan 2017 12:15:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nikula-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=sLXH9ECtAq8EsRy4IOymgtWb4Huz6S/Ygjgjo81UXIc=; b=B/EjLemMXOJb3EZa3xgQd2KK7tIkHwhmITuoREze1w70wu7N9KJNSqsu/qXah4BNUs kJ73i3R/Gy46LTsZaL/GUG8KxV7xMxyBpjlndRUKXO57DRNckuroN2H5t2sfJL0HD3ir 3U+ev8YR7vzUB7mDc7t1Jsmsof2Ep63167nojk5DbrfUjhz6Ve0MxgVJeriJiGpfD9Az xHX1fIvla7zk8WB85RqKvScubT45g0kTFNmZB4QCsigHEL6Eg7YkwqX0rHNLokIIhBLp enadmX+15UedI9OPGQnpfD6SKv31JL36OH7U0sbIrhQzei7+z1yDjwhCGQXu1C3ff+4J 1tXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=sLXH9ECtAq8EsRy4IOymgtWb4Huz6S/Ygjgjo81UXIc=; b=h1jBx0dWMWUIkGy32oTQHdfv7AUaK/1+gw7xANzXKc7RIJhI1hD5TAfTxSddokYeAZ gXyPeKqU8h6TANje7y7gdlm7tO8v2vYiDqIzKZXdqY1arqOjy1uApasjwX4/1AwrCTfB 7xYJsvIWgb4kgfpSI3OKbywloEbsMWZZ8AAOlSQUIz+fuCIcUOmKvQDS3JaVj/dIiliJ zGDA9zSv+nOSgSjxscTlBiFenBR4BlNkpBc7UA6oPOzUKZ4xrcqqt/mtklkr08pRBrdL tEO8z4cYDSlk8QR9cQXq2X4R3boFTQENAWUh26950I62yepLUDbADVl1V+9qtbzs2Tmf PoRw== X-Gm-Message-State: AIkVDXLONucVZSjWudFRLYZTmpkZz6lAPWlRnh+BJIcyIep4YCYEQlEzy0cR6ngrwBe5yA== X-Received: by 10.25.132.6 with SMTP id g6mr1936395lfd.144.1483733699034; Fri, 06 Jan 2017 12:14:59 -0800 (PST) Received: from localhost (dsl-hkibrasgw2-58c367-183.dhcp.inet.fi. [88.195.103.183]) by smtp.gmail.com with ESMTPSA id t26sm14071973lja.48.2017.01.06.12.14.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jan 2017 12:14:58 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH 5/9] cli/show: rename format_sel to simply format Date: Fri, 6 Jan 2017 22:14:46 +0200 Message-Id: <3e5cf688a1bbb78c809066f2be5f363cd079e3ab.1483733461.git.jani@nikula.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Fri, 06 Jan 2017 20:15:07 -0000 Now that the format pointer is a temporary variable, and named formatter, shorten format_sel to format. No functional changes. --- notmuch-show.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/notmuch-show.c b/notmuch-show.c index 93b51008381c..1032694edcd9 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -1018,13 +1018,13 @@ notmuch_show_command (notmuch_config_t *config, int argc, char *argv[]) }, .include_html = FALSE }; - int format_sel = NOTMUCH_FORMAT_NOT_SPECIFIED; + int format = NOTMUCH_FORMAT_NOT_SPECIFIED; int exclude = EXCLUDE_TRUE; int entire_thread = ENTIRE_THREAD_DEFAULT; notmuch_bool_t single_message; notmuch_opt_desc_t options[] = { - { NOTMUCH_OPT_KEYWORD, &format_sel, "format", 'f', + { NOTMUCH_OPT_KEYWORD, &format, "format", 'f', (notmuch_keyword_t []){ { "json", NOTMUCH_FORMAT_JSON }, { "text", NOTMUCH_FORMAT_TEXT }, { "sexp", NOTMUCH_FORMAT_SEXP }, @@ -1063,20 +1063,20 @@ notmuch_show_command (notmuch_config_t *config, int argc, char *argv[]) /* specifying a part implies single message display */ single_message = params.part >= 0; - if (format_sel == NOTMUCH_FORMAT_NOT_SPECIFIED) { + if (format == NOTMUCH_FORMAT_NOT_SPECIFIED) { /* if part was requested and format was not specified, use format=raw */ if (params.part >= 0) - format_sel = NOTMUCH_FORMAT_RAW; + format = NOTMUCH_FORMAT_RAW; else - format_sel = NOTMUCH_FORMAT_TEXT; + format = NOTMUCH_FORMAT_TEXT; } - if (format_sel == NOTMUCH_FORMAT_MBOX) { + if (format == NOTMUCH_FORMAT_MBOX) { if (params.part > 0) { fprintf (stderr, "Error: specifying parts is incompatible with mbox output format.\n"); return EXIT_FAILURE; } - } else if (format_sel == NOTMUCH_FORMAT_RAW) { + } else if (format == NOTMUCH_FORMAT_RAW) { /* raw format only supports single message display */ single_message = TRUE; } @@ -1086,8 +1086,7 @@ notmuch_show_command (notmuch_config_t *config, int argc, char *argv[]) /* Default is entire-thread = FALSE except for format=json and * format=sexp. */ if (entire_thread == ENTIRE_THREAD_DEFAULT) { - if (format_sel == NOTMUCH_FORMAT_JSON || - format_sel == NOTMUCH_FORMAT_SEXP) + if (format == NOTMUCH_FORMAT_JSON || format == NOTMUCH_FORMAT_SEXP) entire_thread = ENTIRE_THREAD_TRUE; else entire_thread = ENTIRE_THREAD_FALSE; @@ -1098,15 +1097,14 @@ notmuch_show_command (notmuch_config_t *config, int argc, char *argv[]) fprintf (stderr, "Warning: --body=false is incompatible with --part > 0. Disabling.\n"); params.output_body = TRUE; } else { - if (format_sel != NOTMUCH_FORMAT_JSON && - format_sel != NOTMUCH_FORMAT_SEXP) + if (format != NOTMUCH_FORMAT_JSON && format != NOTMUCH_FORMAT_SEXP) fprintf (stderr, "Warning: --body=false only implemented for format=json and format=sexp\n"); } } if (params.include_html && - (format_sel != NOTMUCH_FORMAT_JSON && format_sel != NOTMUCH_FORMAT_SEXP)) { + (format != NOTMUCH_FORMAT_JSON && format != NOTMUCH_FORMAT_SEXP)) { fprintf (stderr, "Warning: --include-html only implemented for format=json and format=sexp\n"); } @@ -1141,7 +1139,7 @@ notmuch_show_command (notmuch_config_t *config, int argc, char *argv[]) } /* Create structure printer. */ - formatter = formatters[format_sel]; + formatter = formatters[format]; sprinter = formatter->new_sprinter(config, stdout); /* If a single message is requested we do not use search_excludes. */ -- 2.11.0