Updated --version argument to give more detailed output.

This commit is contained in:
Thulinma 2015-09-03 17:54:20 +02:00
parent 2fb1459dff
commit 096b289cdf
15 changed files with 30 additions and 29 deletions

View file

@ -133,7 +133,7 @@ int main(int argc, char ** argv){
if ( !stored_user["default"]){
stored_user["default"] = "root";
}
Controller::conf = Util::Config(argv[0], PACKAGE_VERSION " / " RELEASE);
Controller::conf = Util::Config(argv[0]);
Controller::conf.addOption("listen_port", stored_port);
Controller::conf.addOption("listen_interface", stored_interface);
Controller::conf.addOption("username", stored_user);

View file

@ -167,7 +167,7 @@ int Controller::handleAPIConnection(Socket::Connection & conn){
H.Clean();
H.SetHeader("Content-Type", "text/html");
H.SetHeader("X-Info", "To force an API response, request the file /api");
H.SetHeader("Server", "mistserver/" PACKAGE_VERSION "/" + Util::Config::libver + "/" RELEASE);
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
H.SetHeader("Content-Length", server_html_len);
H.SendResponse("200", "OK", conn);
conn.SendNow(server_html, server_html_len);
@ -313,7 +313,7 @@ int Controller::handleAPIConnection(Socket::Connection & conn){
}
//sent current configuration, no matter if it was changed or not
Response["config"] = Controller::Storage["config"];
Response["config"]["version"] = PACKAGE_VERSION "/" + Util::Config::libver + "/" RELEASE;
Response["config"]["version"] = PACKAGE_VERSION;
Response["streams"] = Controller::Storage["streams"];
//add required data to the current unix time to the config, for syncing reasons
Response["config"]["time"] = Util::epoch();