[PATCH 5/9] cli: reduce indent in keyword argument processing

Jani Nikula jani at nikula.org
Tue Sep 19 13:39:25 PDT 2017


Reducing indent makes future changes easier. No functional changes.
---
 command-line-arguments.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/command-line-arguments.c b/command-line-arguments.c
index 1373dbbb5225..a79afcaf8a15 100644
--- a/command-line-arguments.c
+++ b/command-line-arguments.c
@@ -21,15 +21,17 @@ _process_keyword_arg (const notmuch_opt_desc_t *arg_desc, char next, const char
     }
 
     for (keywords = arg_desc->keywords; keywords->name; keywords++) {
-	if (strcmp (arg_str, keywords->name) == 0) {
-	    if (arg_desc->output_var) {
-		if (arg_desc->opt_type == NOTMUCH_OPT_KEYWORD_FLAGS)
-		    *((int *)arg_desc->output_var) |= keywords->value;
-		else
-		    *((int *)arg_desc->output_var) = keywords->value;
-	    }
-	    return TRUE;
+	if (strcmp (arg_str, keywords->name) != 0)
+	    continue;
+
+	if (arg_desc->output_var) {
+	    if (arg_desc->opt_type == NOTMUCH_OPT_KEYWORD_FLAGS)
+		*((int *)arg_desc->output_var) |= keywords->value;
+	    else
+		*((int *)arg_desc->output_var) = keywords->value;
 	}
+
+	return TRUE;
     }
     if (next != '\0')
 	fprintf (stderr, "Unknown keyword argument \"%s\" for option \"%s\".\n", arg_str, arg_desc->name);
-- 
2.11.0



More information about the notmuch mailing list