From: Wayne Davison Date: Sun, 21 Jun 2020 02:42:14 +0000 (-0700) Subject: Require -VV to see SIMD & ASM in version output X-Git-Tag: v3.2.1pre1~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6b237b0fe9b0941c51afc9e880a28c47583a11de;p=thirdparty%2Frsync.git Require -VV to see SIMD & ASM in version output --- diff --git a/options.c b/options.c index 2e8731ab..3fee6691 100644 --- a/options.c +++ b/options.c @@ -180,6 +180,7 @@ int rsync_port = 0; int alt_dest_type = 0; int basis_dir_cnt = 0; +static int version_opt_cnt = 0; static int remote_option_alloc = 0; int remote_option_cnt = 0; const char **remote_options = NULL; @@ -582,6 +583,18 @@ static void print_capabilities(enum logcode f) istring("%d-bit timestamps", (int)(sizeof (time_t) * 8)), istring("%d-bit long ints", (int)(sizeof (int64) * 8)), + "*" +#ifndef HAVE_SIMD + "no " +#endif + "SIMD", + + "*" +#ifndef HAVE_ASM + "no " +#endif + "ASM", + #ifndef HAVE_SOCKETPAIR "no " #endif @@ -639,11 +652,6 @@ static void print_capabilities(enum logcode f) #endif "prealloc", -#ifndef HAVE_SIMD - "no " -#endif - "SIMD", - NULL }; @@ -651,6 +659,12 @@ static void print_capabilities(enum logcode f) char *cap = capabilities[j]; int cap_len = cap ? strlen(cap) : 1000; int need_comma = cap && capabilities[j+1] != NULL ? 1 : 0; + if (cap && *cap == '*') { + if (version_opt_cnt < 2) + continue; + cap++; + cap_len--; + } if (line_len + 1 + cap_len + need_comma >= (int)sizeof line_buf) { rprintf(f, " %s\n", line_buf); line_len = 0; @@ -1361,8 +1375,8 @@ int parse_arguments(int *argc_p, const char ***argv_p) switch (opt) { case 'V': - print_rsync_version(FINFO); - exit_cleanup(0); + version_opt_cnt++; + break; case OPT_SERVER: if (!am_server) { @@ -1848,6 +1862,11 @@ int parse_arguments(int *argc_p, const char ***argv_p) } } + if (version_opt_cnt) { + print_rsync_version(FINFO); + exit_cleanup(0); + } + if (protect_args < 0) { if (am_server) protect_args = 0;