<commit_before>/*
* Copyright (c) 2013-2017, The PurpleI2P Project
*
* This file is part of Purple i2pd project and licensed under BSD3
*
* See full license text in LICENSE file at top of project tree
*/

#include <cstdlib>
#include <iostream>
#include <fstream>
#include <map>
#include <string>
#include <boost/program_options/cmdline.hpp>
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/program_options/variables_map.hpp>

#include "Identity.h"
#include "Config.h"
#include "version.h"

using namespace boost::program_options;

namespace i2p {
namespace config {
	options_description m_OptionsDesc;
	variables_map m_Options;

	void Init()
	{
		options_description general("General options");
		general.add_options()
			("help",                                                          "Show this message")
			("conf", value<std::string>()->default_value(""),                 "Path to main i2pd config file (default: try ~/.i2pd/i2pd.conf or /var/lib/i2pd/i2pd.conf)")
			("tunconf", value<std::string>()->default_value(""),              "Path to config with tunnels list and options (default: try ~/.i2pd/tunnels.conf or /var/lib/i2pd/tunnels.conf)")
			("pidfile", value<std::string>()->default_value(""),              "Path to pidfile (default: ~/i2pd/i2pd.pid or /var/lib/i2pd/i2pd.pid)")
			("log", value<std::string>()->default_value(""),                  "Logs destination: stdout, file, syslog (stdout if not set)")
			("logfile", value<std::string>()->default_value(""),              "Path to logfile (stdout if not set, autodetect if daemon)")
			("loglevel", value<std::string>()->default_value("info"),         "Set the minimal level of log messages (debug, info, warn, error, none)")
			("logclftime", value<bool>()->default_value(false),               "Write full CLF-formatted date and time to log (default: write only time)")
			("family", value<std::string>()->default_value(""),               "Specify a family, router belongs to")
			("datadir", value<std::string>()->default_value(""),              "Path to storage of i2pd data (RI, keys, peer profiles, ...)")
			("host", value<std::string>()->default_value("0.0.0.0"),          "External IP")
			("ifname", value<std::string>()->default_value(""),               "Network interface to bind to")
			("ifname4", value<std::string>()->default_value(""),              "Network interface to bind to for ipv4")
			("ifname6", value<std::string>()->default_value(""),              "Network interface to bind to for ipv6")
			("nat", value<bool>()->default_value(true),                       "Should we assume we are behind NAT?")
			("port", value<uint16_t>()->default_value(0),                     "Port to listen for incoming connections (default: auto)")
			("ipv4", value<bool>()->default_value(true),                      "Enable communication through ipv4")
			("ipv6", value<bool>()->default_value(false),                     "Enable communication through ipv6")
			("netid", value<int>()->default_value(I2PD_NET_ID),               "Specify NetID. Main I2P is 2")
			("daemon", value<bool>()->default_value(false),                   "Router will go to background after start")
			("service", value<bool>()->default_value(false),                  "Router will use system folders like '/var/lib/i2pd'")
			("notransit", value<bool>()->default_value(false),                "Router will not accept transit tunnels at startup")
			("floodfill", value<bool>()->default_value(false),                "Router will be floodfill")
			("bandwidth", value<std::string>()->default_value(""),            "Bandwidth limit: integer in KBps or letters: L (32), O (256), P (2048), X (>9000)")
			("share", value<int>()->default_value(100),                       "Limit of transit traffic from max bandwidth in percents. (default: 100")
			("ntcp", value<bool>()->default_value(true),                      "Enable NTCP transport")
			("ssu", value<bool>()->default_value(true),                       "Enable SSU transport")
			("ntcpproxy", value<std::string>()->default_value(""),            "Proxy URL for NTCP transport")<commit_msg>addng forgotten bracket<commit_after>/*
* Copyright (c) 2013-2017, The PurpleI2P Project
*
* This file is part of Purple i2pd project and licensed under BSD3
*
* See full license text in LICENSE file at top of project tree
*/

#include <cstdlib>
#include <iostream>
#include <fstream>
#include <map>
#include <string>
#include <boost/program_options/cmdline.hpp>
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/program_options/variables_map.hpp>

#include "Identity.h"
#include "Config.h"
#include "version.h"

using namespace boost::program_options;

namespace i2p {
namespace config {
	options_description m_OptionsDesc;
	variables_map m_Options;

	void Init()
	{
		options_description general("General options");
		general.add_options()
			("help",                                                          "Show this message")
			("conf", value<std::string>()->default_value(""),                 "Path to main i2pd config file (default: try ~/.i2pd/i2pd.conf or /var/lib/i2pd/i2pd.conf)")
			("tunconf", value<std::string>()->default_value(""),              "Path to config with tunnels list and options (default: try ~/.i2pd/tunnels.conf or /var/lib/i2pd/tunnels.conf)")
			("pidfile", value<std::string>()->default_value(""),              "Path to pidfile (default: ~/i2pd/i2pd.pid or /var/lib/i2pd/i2pd.pid)")
			("log", value<std::string>()->default_value(""),                  "Logs destination: stdout, file, syslog (stdout if not set)")
			("logfile", value<std::string>()->default_value(""),              "Path to logfile (stdout if not set, autodetect if daemon)")
			("loglevel", value<std::string>()->default_value("info"),         "Set the minimal level of log messages (debug, info, warn, error, none)")
			("logclftime", value<bool>()->default_value(false),               "Write full CLF-formatted date and time to log (default: write only time)")
			("family", value<std::string>()->default_value(""),               "Specify a family, router belongs to")
			("datadir", value<std::string>()->default_value(""),              "Path to storage of i2pd data (RI, keys, peer profiles, ...)")
			("host", value<std::string>()->default_value("0.0.0.0"),          "External IP")
			("ifname", value<std::string>()->default_value(""),               "Network interface to bind to")
			("ifname4", value<std::string>()->default_value(""),              "Network interface to bind to for ipv4")
			("ifname6", value<std::string>()->default_value(""),              "Network interface to bind to for ipv6")
			("nat", value<bool>()->default_value(true),                       "Should we assume we are behind NAT?")
			("port", value<uint16_t>()->default_value(0),                     "Port to listen for incoming connections (default: auto)")
			("ipv4", value<bool>()->default_value(true),                      "Enable communication through ipv4")
			("ipv6", value<bool>()->default_value(false),                     "Enable communication through ipv6")
			("netid", value<int>()->default_value(I2PD_NET_ID),               "Specify NetID. Main I2P is 2")
			("daemon", value<bool>()->default_value(false),                   "Router will go to background after start")
			("service", value<bool>()->default_value(false),                  "Router will use system folders like '/var/lib/i2pd'")
			("notransit", value<bool>()->default_value(false),                "Router will not accept transit tunnels at startup")
			("floodfill", value<bool>()->default_value(false),                "Router will be floodfill")
			("bandwidth", value<std::string>()->default_value(""),            "Bandwidth limit: integer in KBps or letters: L (32), O (256), P (2048), X (>9000)")
			("share", value<int>()->default_value(100),                       "Limit of transit traffic from max bandwidth in percents. (default: 100)")
			("ntcp", value<bool>()->default_value(true),                      "Enable NTCP transport")
			("ssu", value<bool>()->default_value(true),                       "Enable SSU transport")
			("ntcpproxy", value<std::string>()->default_value(""),            "Proxy URL for NTCP transport")
{'fraction_non_alphanumeric': 0.16220434626005523, 'fraction_numerical': 0.014887741625645335, 'mean_word_length': 3.162918540729635, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 131, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5856656', 'n_tokens_mistral': 2618, 'n_tokens_neox': 2406, 'n_words': 667}