mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-24 06:16:30 +03:00
Add --version flag
This commit is contained in:
parent
b4aac9c38b
commit
1934e6858b
@ -23,6 +23,7 @@
|
|||||||
#include "base/task/task_scheduler/task_scheduler.h"
|
#include "base/task/task_scheduler/task_scheduler.h"
|
||||||
#include "base/values.h"
|
#include "base/values.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
|
#include "components/version_info/version_info.h"
|
||||||
#include "net/base/auth.h"
|
#include "net/base/auth.h"
|
||||||
#include "net/dns/host_resolver.h"
|
#include "net/dns/host_resolver.h"
|
||||||
#include "net/dns/mapped_host_resolver.h"
|
#include "net/dns/mapped_host_resolver.h"
|
||||||
@ -149,6 +150,7 @@ bool ParseCommandLineFlags(Params* params) {
|
|||||||
"\n"
|
"\n"
|
||||||
"Options:\n"
|
"Options:\n"
|
||||||
"-h, --help Show this message\n"
|
"-h, --help Show this message\n"
|
||||||
|
"--version Print version\n"
|
||||||
"--addr=<address> Address to listen on (0.0.0.0)\n"
|
"--addr=<address> Address to listen on (0.0.0.0)\n"
|
||||||
"--port=<port> Port to listen on (1080)\n"
|
"--port=<port> Port to listen on (1080)\n"
|
||||||
"--proto=[socks|http] Protocol to accept (socks)\n"
|
"--proto=[socks|http] Protocol to accept (socks)\n"
|
||||||
@ -161,6 +163,12 @@ bool ParseCommandLineFlags(Params* params) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (line.HasSwitch("version")) {
|
||||||
|
LOG(INFO) << "Version: " << version_info::GetVersionNumber();
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
params->listen_addr = "0.0.0.0";
|
params->listen_addr = "0.0.0.0";
|
||||||
if (line.HasSwitch("addr")) {
|
if (line.HasSwitch("addr")) {
|
||||||
params->listen_addr = line.GetSwitchValueASCII("addr");
|
params->listen_addr = line.GetSwitchValueASCII("addr");
|
||||||
|
Loading…
Reference in New Issue
Block a user