diff options
author | Wayne Davison <wayne@opencoder.net> | 2020-06-30 19:11:28 -0700 |
---|---|---|
committer | Wayne Davison <wayne@opencoder.net> | 2020-06-30 19:31:59 -0700 |
commit | feb2fff894fff1509fd132bbe80f123d28fcea72 (patch) | |
tree | 266534c9ae4fe8aece95e2c28cf8f77215809631 | |
parent | 7d30490ef4ff30746e09d3919c304d6f0bce2d42 (diff) | |
download | rsync-feb2fff894fff1509fd132bbe80f123d28fcea72.tar.gz |
Put the optimizations into their own list.
-rw-r--r-- | NEWS.md | 2 | ||||
-rw-r--r-- | options.c | 36 | ||||
-rw-r--r-- | rsync.1.md | 3 |
3 files changed, 17 insertions, 24 deletions
@@ -43,6 +43,8 @@ Protocol: 31 (unchanged) die when out of memory. This eliminated some caller-side check-and-die code and added some missing sanity-checking of allocations. + - Put optimizations into their own list in the `--version` output. + - Improved the man page a bit more. ### PACKAGING RELATED: @@ -581,12 +581,15 @@ static char *istring(const char *fmt, int val) return str; } -static void print_capabilities(enum logcode f) +static void print_info_flags(enum logcode f) { STRUCT_STAT *dumstat; char line_buf[75]; int line_len, j; char *capabilities[] = { + + "*Capabilities", + istring("%d-bit files", (int)(sizeof (OFF_T) * 8)), istring("%d-bit inums", (int)(sizeof dumstat->st_ino * 8)), /* Don't check ino_t! */ istring("%d-bit timestamps", (int)(sizeof (time_t) * 8)), @@ -661,7 +664,8 @@ static void print_capabilities(enum logcode f) #endif "prealloc", - "*" /* All options after this point are hidden w/o -V -V */ + "*Optimizations", + #ifndef HAVE_SIMD "no " #endif @@ -681,28 +685,19 @@ static void print_capabilities(enum logcode f) }; for (line_len = 0, j = 0; ; j++) { - char *cap = capabilities[j]; - if (!cap) - break; - if (*cap == '*') { - if (version_opt_cnt >= 2) - capabilities[j]++; - else - capabilities[j] = NULL; - break; - } - } - - for (line_len = 0, j = 0; ; j++) { - char *cap = capabilities[j]; - int cap_len = cap ? strlen(cap) : 1000; - int need_comma = cap && capabilities[j+1] != NULL ? 1 : 0; - if (line_len + 1 + cap_len + need_comma >= (int)sizeof line_buf) { + char *cap = capabilities[j], *next_cap = cap ? capabilities[j+1] : NULL; + int cap_len = cap && *cap != '*' ? strlen(cap) : 1000; + int need_comma = next_cap && *next_cap != '*' ? 1 : 0; + if (line_len && line_len + 1 + cap_len + need_comma >= (int)sizeof line_buf) { rprintf(f, " %s\n", line_buf); line_len = 0; } if (!cap) break; + if (*cap == '*') { + rprintf(f, "%s:\n", cap+1); + continue; + } line_len += snprintf(line_buf+line_len, sizeof line_buf - line_len, " %s%s", cap, need_comma ? "," : ""); } } @@ -720,8 +715,7 @@ static void print_rsync_version(enum logcode f) rprintf(f, "Copyright (C) 1996-" LATEST_YEAR " by Andrew Tridgell, Wayne Davison, and others.\n"); rprintf(f, "Web site: https://rsync.samba.org/\n"); - rprintf(f, "Capabilities:\n"); - print_capabilities(f); + print_info_flags(f); rprintf(f, "Checksum list:\n"); get_default_nno_list(&valid_checksums, tmpbuf, sizeof tmpbuf, '('); @@ -521,9 +521,6 @@ your home directory (remove the '=' for that). list of compression algorithms, a list of compiled-in capabilities, a link to the rsync web site, and some license/copyright info. - Repeat the option (`-VV`) to include some optimization info at the end of - the capabilities list. - 0. `--verbose`, `-v` This option increases the amount of information you are given during the |