This commit is contained in:
10
src/main.cpp
10
src/main.cpp
@@ -8,6 +8,8 @@
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
|
||||
#include "version.hpp"
|
||||
|
||||
namespace simple_object_storage {
|
||||
|
||||
std::atomic<bool> g_running{true};
|
||||
@@ -106,6 +108,14 @@ void signal_handler(int signal) {
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
if (argc > 1) {
|
||||
if (std::string(argv[1]) == "version") {
|
||||
std::cout << dropshell::VERSION << std::endl;
|
||||
return 0;
|
||||
}
|
||||
std::cout << "simple_object_storage version: " << dropshell::VERSION << std::endl;
|
||||
}
|
||||
|
||||
// Set up signal handlers
|
||||
struct sigaction sa;
|
||||
sa.sa_handler = signal_handler;
|
||||
|
21
src/version.hpp.in
Normal file
21
src/version.hpp.in
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
|
||||
version.hpp is automatically generated by the build system, from version.hpp.in.
|
||||
|
||||
DO NOT EDIT VERSION.HPP!
|
||||
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace dropshell {
|
||||
|
||||
// Version information
|
||||
const std::string VERSION = "@PROJECT_VERSION@";
|
||||
const std::string RELEASE_DATE = "@RELEASE_DATE@";
|
||||
const std::string AUTHOR = "j842";
|
||||
const std::string LICENSE = "MIT";
|
||||
|
||||
} // namespace dropshell
|
Reference in New Issue
Block a user