diff --git a/src/cli.cpp b/src/cli.cpp index f0d138e3..3e8097b6 100644 --- a/src/cli.cpp +++ b/src/cli.cpp @@ -17,7 +17,7 @@ static const char *exe_name = NULL; static const char* help_text = - "Vitastor command-line tool\n" + "Vitastor command-line tool " VERSION "\n" "(c) Vitaliy Filippov, 2019+ (VNPL-1.1)\n" "\n" "COMMANDS:\n" diff --git a/src/disk_tool.cpp b/src/disk_tool.cpp index 37dc6af7..2d4b2490 100644 --- a/src/disk_tool.cpp +++ b/src/disk_tool.cpp @@ -5,7 +5,7 @@ #include "str_util.h" static const char *help_text = - "Vitastor disk management tool\n" + "Vitastor disk management tool " VERSION "\n" "(c) Vitaliy Filippov, 2022+ (VNPL-1.1)\n" "\n" "COMMANDS:\n" diff --git a/src/osd_main.cpp b/src/osd_main.cpp index 336c69be..e7ec13cb 100644 --- a/src/osd_main.cpp +++ b/src/osd_main.cpp @@ -19,6 +19,14 @@ static void handle_sigint(int sig) exit(0); } +static const char* help_text = + "Vitastor OSD (block object storage daemon) " VERSION "\n" + "(c) Vitaliy Filippov, 2019+ (VNPL-1.1)\n" + "\n" + "OSDs are usually started by vitastor-disk.\n" + "Manual usage: vitastor-osd [--option value] ...\n" +; + int main(int narg, char *args[]) { setvbuf(stdout, NULL, _IONBF, 0); @@ -37,6 +45,16 @@ int main(int narg, char *args[]) char *opt = args[i]+2; config[std::string(opt)] = std::string(args[++i]); } + else if (!strcmp(args[i], "--help")) + { + printf("%s", help_text); + return 0; + } + } + if (!config.size()) + { + printf("%s", help_text); + return 1; } signal(SIGINT, handle_sigint); signal(SIGTERM, handle_sigint);