]> git.notmuchmail.org Git - notmuch/commitdiff
cli/show: consistently use format_sel for checking the format
authorJani Nikula <jani@nikula.org>
Fri, 6 Jan 2017 20:14:44 +0000 (22:14 +0200)
committerDavid Bremner <david@tethera.net>
Fri, 10 Mar 2017 11:47:56 +0000 (07:47 -0400)
The mixed use of the format pointer and the format selection variables
is confusing. Add more clarity by using format_sel alone. No
functional changes.

notmuch-show.c

index ef675b4ded411e5db31b83fff86b740e7b73572c..2cec339a129539963bc7b54d1c5ecfa17bfdd199 100644 (file)
@@ -1122,7 +1122,8 @@ 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 == &format_json || format == &format_sexp)
+       if (format_sel == NOTMUCH_FORMAT_JSON ||
+           format_sel == NOTMUCH_FORMAT_SEXP)
            entire_thread = ENTIRE_THREAD_TRUE;
        else
            entire_thread = ENTIRE_THREAD_FALSE;
@@ -1133,7 +1134,8 @@ 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 != &format_json && format != &format_sexp)
+           if (format_sel != NOTMUCH_FORMAT_JSON &&
+               format_sel != NOTMUCH_FORMAT_SEXP)
                fprintf (stderr,
                         "Warning: --body=false only implemented for format=json and format=sexp\n");
        }