From 1934e6858bbe1c2b63a8ec2998d3db17e444b13d Mon Sep 17 00:00:00 2001 From: klzgrad Date: Mon, 10 Dec 2018 02:22:09 -0500 Subject: [PATCH] Add --version flag --- src/net/tools/naive/naive_proxy_bin.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/net/tools/naive/naive_proxy_bin.cc b/src/net/tools/naive/naive_proxy_bin.cc index 4ee6bccf59..16cf13b886 100644 --- a/src/net/tools/naive/naive_proxy_bin.cc +++ b/src/net/tools/naive/naive_proxy_bin.cc @@ -23,6 +23,7 @@ #include "base/task/task_scheduler/task_scheduler.h" #include "base/values.h" #include "build/build_config.h" +#include "components/version_info/version_info.h" #include "net/base/auth.h" #include "net/dns/host_resolver.h" #include "net/dns/mapped_host_resolver.h" @@ -149,6 +150,7 @@ bool ParseCommandLineFlags(Params* params) { "\n" "Options:\n" "-h, --help Show this message\n" + "--version Print version\n" "--addr=
Address to listen on (0.0.0.0)\n" "--port= Port to listen on (1080)\n" "--proto=[socks|http] Protocol to accept (socks)\n" @@ -161,6 +163,12 @@ bool ParseCommandLineFlags(Params* params) { return false; } + if (line.HasSwitch("version")) { + LOG(INFO) << "Version: " << version_info::GetVersionNumber(); + exit(EXIT_SUCCESS); + return false; + } + params->listen_addr = "0.0.0.0"; if (line.HasSwitch("addr")) { params->listen_addr = line.GetSwitchValueASCII("addr");