From a1f3c40a2de805e20ceb30a75906b99508743b86 Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Mon, 30 Sep 2019 17:31:33 -0700 Subject: [PATCH] ws has a --version option --- DOCKER_VERSION | 2 +- docs/CHANGELOG.md | 4 ++++ ixwebsocket/IXWebSocketVersion.h | 2 +- ws/ws.cpp | 13 ++++++++++++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/DOCKER_VERSION b/DOCKER_VERSION index 91e4a9f2..7849b73d 100644 --- a/DOCKER_VERSION +++ b/DOCKER_VERSION @@ -1 +1 @@ -6.3.2 +6.3.3 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 6dd48f57..d711f4ca 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -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. diff --git a/ixwebsocket/IXWebSocketVersion.h b/ixwebsocket/IXWebSocketVersion.h index 7a879220..b1c46364 100644 --- a/ixwebsocket/IXWebSocketVersion.h +++ b/ixwebsocket/IXWebSocketVersion.h @@ -6,4 +6,4 @@ #pragma once -#define IX_WEBSOCKET_VERSION "6.3.2" +#define IX_WEBSOCKET_VERSION "6.3.3" diff --git a/ws/ws.cpp b/ws/ws.cpp index 6195f92a..9b26603b 100644 --- a/ws/ws.cpp +++ b/ws/ws.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -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;