chore: polishing. put basic usage info to stdout using one call to a void messing lines (#5019)

chore: polishing. put basic usage info to stdout using one call to avoid messing with lines
This commit is contained in:
Volodymyr Yavdoshenko 2025-04-28 17:45:20 +03:00 committed by GitHub
parent 70be62c6a1
commit 23d310b607
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,3 @@
// Copyright 2023, DragonflyDB authors. All rights reserved.
// See LICENSE for licensing terms.
//
@ -649,30 +648,36 @@ void sigill_hdlr(int signo) {
}
void PrintBasicUsageInfo() {
std::cout << " .--::--. \n";
std::cout << " :+*=: =@@@@@@@@= :+*+: \n";
std::cout << " %@@@@@@%*=. =@@@@@@@@- .=*%@@@@@@# \n";
std::cout << " @@@@@@@@@@@@#+-. .%@@@@#. .-+#@@@@@@@@@@@% \n";
std::cout << " -@@@@@@@@@@@@@@@@*:#@@#:*@@@@@@@@@@@@@@@@- \n";
std::cout << " :+*********####-%@%%@%-####********++. \n";
std::cout << " .%@@@@@@@@@@@@@%:@@@@@@:@@@@@@@@@@@@@@% \n";
std::cout << " .@@@@@@@@%*+-: =@@@@= .:-+*%@@@@@@@%. \n";
std::cout << " =*+-: ###* .:-+*= \n";
std::cout << " %@@% \n";
std::cout << " *@@* \n";
std::cout << " +@@= \n";
std::cout << " :##: \n";
std::cout << " :@@: \n";
std::cout << " @@ \n";
std::cout << " .. \n";
std::cout << "* Logs will be written to the first available of the following paths:\n";
std::string output =
" .--::--. \n"
" :+*=: =@@@@@@@@= :+*+: \n"
" %@@@@@@%*=. =@@@@@@@@- .=*%@@@@@@# \n"
" @@@@@@@@@@@@#+-. .%@@@@#. .-+#@@@@@@@@@@@% \n"
" -@@@@@@@@@@@@@@@@*:#@@#:*@@@@@@@@@@@@@@@@- \n"
" :+*********####-%@%%@%-####********++. \n"
" .%@@@@@@@@@@@@@%:@@@@@@:@@@@@@@@@@@@@@% \n"
" .@@@@@@@@%*+-: =@@@@= .:-+*%@@@@@@@%. \n"
" =*+-: ###* .:-+*= \n"
" %@@% \n"
" *@@* \n"
" +@@= \n"
" :##: \n"
" :@@: \n"
" @@ \n"
" .. \n"
"* Logs will be written to the first available of the following paths:\n";
for (const auto& dir : google::GetLoggingDirectories()) {
const string_view maybe_slash = absl::EndsWith(dir, "/") ? "" : "/";
std::cout << dir << maybe_slash << "dragonfly.*\n";
absl::StrAppend(&output, dir, maybe_slash, "dragonfly.*\n");
}
std::cout << "* For the available flags type dragonfly [--help | --helpfull]\n";
std::cout << "* Documentation can be found at: https://www.dragonflydb.io/docs";
std::cout << endl;
absl::StrAppend(&output,
"* For the available flags type dragonfly [--help | --helpfull]\n"
"* Documentation can be found at: https://www.dragonflydb.io/docs\n");
std::cout << output;
std::cout.flush();
}
void ParseFlagsFromEnv() {