./configure (optional if already run)
make
-based-on: 24174f9a96b191bff8f9420573de468a769c2ed9
+based-on: 1f12b196fd049058e1d12bdf8e9b01dd05f656f0
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
int line_len, j;
char *info_flags[] = {
-@@ -161,10 +162,12 @@ static void print_info_flags(enum logcode f)
+@@ -161,49 +162,105 @@ static void print_info_flags(enum logcode f)
NULL
};
+ int str_len = str && *str != '*' ? strlen(str) + (as_json ? 2 : 0) : 1000;
int need_comma = next_nfo && *next_nfo != '*' ? 1 : 0;
if (line_len && line_len + 1 + str_len + need_comma >= (int)sizeof line_buf) {
- rprintf(f, " %s\n", line_buf);
-@@ -173,37 +176,88 @@ static void print_info_flags(enum logcode f)
+- rprintf(f, " %s\n", line_buf);
++ if (as_json)
++ printf(" %s\n", line_buf);
++ else
++ rprintf(f, " %s\n", line_buf);
+ line_len = 0;
+ }
if (!str)
break;
if (*str == '*') {
#ifdef MAINTAINER_MODE
rprintf(f, "Panic Action: \"%s\"\n", get_panic_action());
-@@ -226,7 +280,7 @@ void print_rsync_version(enum logcode f)
+@@ -226,7 +283,7 @@ void print_rsync_version(enum logcode f)
void usage(enum logcode F)
{
rprintf(F,"\n");
rprintf(F,"rsync is a file transfer program capable of efficient remote update\n");
-@@ -253,7 +307,7 @@ void usage(enum logcode F)
+@@ -253,7 +310,7 @@ void usage(enum logcode F)
void daemon_usage(enum logcode F)
{