Add the function of outputting rdcd version information

Change-Id: I0572fd4b98f697660ab9099deabfd4f0fce802f3
Signed-off-by: Chen Gong <curry.gong@amd.com>
이 커밋은 다음에 포함됨:
Chen Gong 작성하고 Galantsev, Dmitrii가 2024-09-10 10:06:44 -05:00를 커밋함
1 부모 ac874d3921
커밋 9f8d447e75
2 파일이 변경됨
+22 -1

검색과 일치하는 파일 없음

+11 -1
파일 보기
@@ -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);