From: Wayne Davison Date: Sun, 11 Sep 2022 00:30:54 +0000 (-0700) Subject: Also change dashes in the dict var names to make jq use easier. X-Git-Tag: v3.2.7pre1~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad53a9b5a04829e84631ef633453b03d64684d1f;p=thirdparty%2Frsync.git Also change dashes in the dict var names to make jq use easier. --- diff --git a/support/json-rsync-version b/support/json-rsync-version index 6f083bae..afaf7382 100755 --- a/support/json-rsync-version +++ b/support/json-rsync-version @@ -35,11 +35,12 @@ def main(): for x in line.strip(' ,').split(', '): if ' ' in x: val, var = x.split(' ', 1) - var = var.replace(' ', '_') if var == 'protect-args': var = 'secluded-args' + var = var.replace(' ', '_').replace('-', '_') info[sect_name][var] = False if val == 'no' else val else: + x = x.replace('-', '_') info[sect_name][x] = True else: info[sect_name] += [ x for x in line.split() if not x.startswith('(') ] diff --git a/usage.c b/usage.c index 84a94b82..a2c2a3f0 100644 --- a/usage.c +++ b/usage.c @@ -179,7 +179,7 @@ static void print_info_flags(enum logcode f) item_len = snprintf(item_buf, sizeof item_buf, " \"%s\": %s%.*s%s%s", item, quot, val_len, val, quot, need_comma ? "," : ""); - for (space = item; (space = strchr(space, ' ')) != NULL; space++) + for (space = item; (space = strpbrk(space, " -")) != NULL; space++) item_buf[space - item + 2] = '_'; } else item_len = snprintf(item_buf, sizeof item_buf, " %s%s", str, need_comma ? "," : "");