summaryrefslogtreecommitdiff
path: root/src/options.cpp
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2010-01-11 03:06:40 +0000
committerOthmar Gsenger <otti@anytun.org>2010-01-11 03:06:40 +0000
commit6399d05591fa48076747fe689a0bebd7c93339e7 (patch)
tree11b1943f5445ad01bcb896d33979c958a0ee0cb1 /src/options.cpp
parentcleaned up crypto init (diff)
cleanup
added cmd line option --debug
Diffstat (limited to 'src/options.cpp')
-rw-r--r--src/options.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/options.cpp b/src/options.cpp
index 6c3437e..86ef03f 100644
--- a/src/options.cpp
+++ b/src/options.cpp
@@ -362,6 +362,7 @@ bool Options::parse(int argc, char* argv[])
progname_ = argv[0];
argc--;
+ bool debug = false;
bool ipv4_only = false, ipv6_only = false;
std::string role = "";
for(int i=1; argc > 0; ++i)
@@ -385,6 +386,7 @@ bool Options::parse(int argc, char* argv[])
#endif
PARSE_STRING_LIST("-L","--log", log_targets_, NOTHING)
+ PARSE_BOOL_PARAM("-U","--debug", debug, NOTHING)
#if defined(ANYCTR_OPTIONS)
@@ -470,6 +472,11 @@ bool Options::parse(int argc, char* argv[])
throw syntax_error("unknown role name: " + role, -1);
}
+ if(debug) {
+ log_targets_.push_back("stdout:5");
+ daemonize_ = false;
+ }
+
if(log_targets_.empty()) {
#ifndef _MSC_VER
#if !defined(ANYCONF_OPTIONS)