Skip to content

Commit 0ea3769

Browse files
Move detailed version info to first line of --version output
Change --version output format to show all build information on the first line: memtier_benchmark v=255.255.255 sha=8985eb5a:1 bits=64 libevent=2.1.12-stable openssl=OpenSSL 3.0.13 30 Jan 2024 This makes it easier to parse and matches the Redis version output style.
1 parent 9878f58 commit 0ea3769

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

memtier_benchmark.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -806,14 +806,8 @@ static int config_parse_args(int argc, char *argv[], struct benchmark_config *cf
806806
case 'v':
807807
{
808808
// Print version information similar to Redis format
809-
printf("%s\n", PACKAGE_STRING);
810-
printf("Copyright (C) 2011-2025 Redis Ltd.\n");
811-
printf("This is free software. You may redistribute copies of it under the terms of\n");
812-
printf("the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n");
813-
printf("There is NO WARRANTY, to the extent permitted by law.\n\n");
814-
815-
// Print detailed version info in Redis-like format
816-
printf("v=%s sha=%s:%s", PACKAGE_VERSION, MEMTIER_GIT_SHA1, MEMTIER_GIT_DIRTY);
809+
// First line: memtier_benchmark v=... sha=... bits=... libevent=... openssl=...
810+
printf("memtier_benchmark v=%s sha=%s:%s", PACKAGE_VERSION, MEMTIER_GIT_SHA1, MEMTIER_GIT_DIRTY);
817811

818812
// Print architecture bits
819813
#if defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__)
@@ -833,6 +827,12 @@ static int config_parse_args(int argc, char *argv[], struct benchmark_config *cf
833827
#endif
834828

835829
printf("\n");
830+
831+
// Copyright and license info
832+
printf("Copyright (C) 2011-2025 Redis Ltd.\n");
833+
printf("This is free software. You may redistribute copies of it under the terms of\n");
834+
printf("the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n");
835+
printf("There is NO WARRANTY, to the extent permitted by law.\n");
836836
}
837837
exit(0);
838838
case 's':

0 commit comments

Comments
 (0)