Add the function of outputting rdcd version information

Change-Id: I0572fd4b98f697660ab9099deabfd4f0fce802f3
Signed-off-by: Chen Gong <curry.gong@amd.com>


[ROCm/rdc commit: 9f8d447e75]
This commit is contained in:
Chen Gong
2024-08-21 12:46:35 +08:00
committed by Galantsev, Dmitrii
parent 5db56b48eb
commit c495b7d086
2 changed files with 22 additions and 1 deletions
+11 -1
View File
@@ -476,10 +476,11 @@ static const struct option long_options[] = {{"address", required_argument, null
{"unauth_comm", no_argument, nullptr, 'u'},
{"pinned_cert", no_argument, nullptr, 'i'},
{"debug", no_argument, nullptr, 'd'},
{"version", no_argument, nullptr, 'v'},
{"help", no_argument, nullptr, 'h'},
{nullptr, 0, nullptr, 0}};
static const char* short_options = "a:p:uidh";
static const char* short_options = "a:p:uidvh";
static void PrintHelp(void) {
std::cout << "Optional rdctst Arguments:\n"
@@ -493,6 +494,7 @@ static void PrintHelp(void) {
"--pinned_cert, -i used \"pinned\" certificates instead of PKI "
"authentication. This is for test purposes.\n"
"--debug, -d output debug messages\n"
"--version, -v Output version information\n"
"--help, -h print this message\n";
}
@@ -538,6 +540,14 @@ uint32_t ProcessCmdline(RdcdCmdLineOpts* cmdl_opts, int arg_cnt, char** arg_list
cmdl_opts->log_dbg = true;
break;
case 'v':
#ifdef CURRENT_GIT_HASH
std::cout << "RDCD : " << RDC_SERVER_VERSION_STRING << "+" << QUOTE(CURRENT_GIT_HASH) << std::endl;
#else
std::cout << "RDCD : " << RDC_SERVER_VERSION_STRING << std::endl;
#endif
exit(0);
case 'h':
PrintHelp();
exit(0);