ws has a --version option

This commit is contained in:
Benjamin Sergeant 2019-09-30 17:31:33 -07:00
parent 1fdbc2bc22
commit a1f3c40a2d
4 changed files with 18 additions and 3 deletions

View File

@ -1 +1 @@
6.3.2
6.3.3

View File

@ -1,6 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.
## [6.3.3] - 2019-09-30
- ws has a --version option
## [6.3.2] - 2019-09-29
- (http + websocket clients) can specify cacert and some other tls options (not implemented on all backend). This makes it so that server certs can finally be validated on windows.

View File

@ -6,4 +6,4 @@
#pragma once
#define IX_WEBSOCKET_VERSION "6.3.2"
#define IX_WEBSOCKET_VERSION "6.3.3"

View File

@ -15,6 +15,7 @@
#include <ixcore/utils/IXCoreLogger.h>
#include <ixwebsocket/IXNetSystem.h>
#include <ixwebsocket/IXSocket.h>
#include <ixwebsocket/IXUserAgent.h>
#include <spdlog/spdlog.h>
#include <sstream>
#include <string>
@ -39,7 +40,6 @@ int main(int argc, char** argv)
}
CLI::App app {"ws is a websocket tool"};
app.require_subcommand();
std::string url("ws://127.0.0.1:8008");
std::string path;
@ -79,6 +79,7 @@ int main(int argc, char** argv)
bool greetings = false;
bool binaryMode = false;
bool redirect = false;
bool version = false;
int port = 8008;
int redisPort = 6379;
int statsdPort = 8125;
@ -103,6 +104,8 @@ int main(int argc, char** argv)
"A (comma/space/colon) separated list of ciphers to use for TLS");
};
app.add_flag("--version", version, "Connection url");
CLI::App* sendApp = app.add_subcommand("send", "Send a file");
sendApp->add_option("url", url, "Connection url")->required();
sendApp->add_option("path", path, "Path to the file to send")
@ -402,6 +405,14 @@ int main(int argc, char** argv)
{
ret = ix::ws_redis_server_main(port, hostname);
}
else if (version)
{
std::cout << "ws " << ix::userAgent() << std::endl;
}
else
{
std::cerr << "A subcommand or --version is required" << std::endl;
}
ix::uninitNetSystem();
return ret;