]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Put the optimizations into their own list.
authorWayne Davison <wayne@opencoder.net>
Wed, 1 Jul 2020 02:11:28 +0000 (19:11 -0700)
committerWayne Davison <wayne@opencoder.net>
Wed, 1 Jul 2020 02:31:59 +0000 (19:31 -0700)
NEWS.md
options.c
rsync.1.md

diff --git a/NEWS.md b/NEWS.md
index d922e8fb55efddfb67d047f7965678e1259e298b..2b192b38b8329b2f9d1da5cbc4b156617acec537 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -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:
index 0e2c0bb0af0d856380d2f51778f3a09cad230fc7..d498e2261051cc9f9e20b0ea4a04ab9cb052e58f 100644 (file)
--- a/options.c
+++ b/options.c
@@ -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, '(');
index d1ffd444e4716445522d3c51376c07c960965eec..67ac4e529dbf1c70f5145b4ea6ae639ae3e6cfc5 100644 (file)
@@ -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