Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit 80ca785

Browse files
committed
libndt-client: add a -version command line flag
1 parent 1a6ccee commit 80ca785

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libndt-client.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ static void usage() {
3333
std::clog << " --socks5h <port> : use socks5h proxy at 127.0.0.1:<port>\n";
3434
std::clog << " --upload : run upload test\n";
3535
std::clog << " --verbose : be verbose\n";
36+
std::clog << " --version : print the version number and exit.\n";
3637
std::clog << " --websocket : use the WebSocket protocol\n";
3738
std::clog << "\n";
3839
std::clog << "If <hostname> is omitted, we pick a nearby server, unless `--random'\n";
@@ -78,6 +79,10 @@ int main(int, char **argv) {
7879
} else if (flag == "verbose") {
7980
settings.verbosity = libndt::verbosity_debug;
8081
std::clog << "will be verbose" << std::endl;
82+
} else if (flag == "version") {
83+
std::cout << libndt::version_major << "." << libndt::version_minor
84+
<< "." << libndt::version_patch << std::endl;
85+
exit(EXIT_SUCCESS);
8186
} else if (flag == "websocket") {
8287
settings.protocol_flags |= libndt::protocol_flag_websocket;
8388
std::clog << "will use WebSocket" << std::endl;

0 commit comments

Comments
 (0)