]> git.stg.codes - ssmd.git/blobdiff - src/settings.cpp
Fix build on osx.
[ssmd.git] / src / settings.cpp
index 6e3a7913c5e4b2463b1e169206a5791b49f8a30f..897793ce880f879f30f370fbf86d635870dd4d4d 100644 (file)
@@ -21,6 +21,8 @@ SettingsParser::SettingsParser()
         ("down-profile-id", po::value<unsigned>(), "switch's download profile id")
         ("max-acl-per-pdu", po::value<size_t>(), "maximum ACL's per PDU")
         ("data-url", po::value<std::string>(), "data access URL")
         ("down-profile-id", po::value<unsigned>(), "switch's download profile id")
         ("max-acl-per-pdu", po::value<size_t>(), "maximum ACL's per PDU")
         ("data-url", po::value<std::string>(), "data access URL")
+        ("script-base", po::value<std::string>(), "base dir for scripts")
+        ("dump-scripts", "dump SNMP command into shell scripts")
         ("version,v", "show ssmd version and exit")
     ;
 }
         ("version,v", "show ssmd version and exit")
     ;
 }
@@ -29,14 +31,13 @@ void SettingsParser::init(int argc, char * argv[])
 {
     po::variables_map vm;
     po::store(po::parse_command_line(argc, argv, _desc), vm);
 {
     po::variables_map vm;
     po::store(po::parse_command_line(argc, argv, _desc), vm);
-    po::notify(vm);    
+    po::notify(vm);
 
     _settings._isHelp = vm.count("help");
     _settings._isVersion = vm.count("version");
 
 
     _settings._isHelp = vm.count("help");
     _settings._isVersion = vm.count("version");
 
-    if (vm.count("config")) {
+    if (vm.count("config"))
         _settings._configFile = vm["config"].as<std::string>();
         _settings._configFile = vm["config"].as<std::string>();
-    }
 
     if (!_settings._isHelp &&
         !_settings._isVersion) {
 
     if (!_settings._isHelp &&
         !_settings._isVersion) {
@@ -48,44 +49,31 @@ void SettingsParser::init(int argc, char * argv[])
         }
     }
 
         }
     }
 
-    if (vm.count("debug")) {
+    if (vm.count("debug"))
         _settings._isDebug = true;
         _settings._isDebug = true;
-    }
-    if (vm.count("daemon")) {
+    if (vm.count("daemon"))
         _settings._isDaemon = true;
         _settings._isDaemon = true;
-    }
 
 
-    if (vm.count("log-file")) {
+    if (vm.count("log-file"))
         _settings._logFile = vm["log-file"].as<std::string>();
         _settings._logFile = vm["log-file"].as<std::string>();
-    }
-
-    if (vm.count("pid-file")) {
+    if (vm.count("pid-file"))
         _settings._PIDFile = vm["pid-file"].as<std::string>();
         _settings._PIDFile = vm["pid-file"].as<std::string>();
-    }
-
-    if (vm.count("switch-sync-interval")) {
+    if (vm.count("switch-sync-interval"))
         _settings._switchSyncInterval = vm["switch-sync-interval"].as<time_t>();
         _settings._switchSyncInterval = vm["switch-sync-interval"].as<time_t>();
-    }
-
-    if (vm.count("info-sync-interval")) {
+    if (vm.count("info-sync-interval"))
         _settings._infoSyncInterval = vm["info-sync-interval"].as<time_t>();
         _settings._infoSyncInterval = vm["info-sync-interval"].as<time_t>();
-    }
-
-    if (vm.count("up-profile-id")) {
+    if (vm.count("up-profile-id"))
         _settings._upProfileId = vm["up-profile-id"].as<unsigned>();
         _settings._upProfileId = vm["up-profile-id"].as<unsigned>();
-    }
-
-    if (vm.count("down-profile-id")) {
+    if (vm.count("down-profile-id"))
         _settings._downProfileId = vm["down-profile-id"].as<unsigned>();
         _settings._downProfileId = vm["down-profile-id"].as<unsigned>();
-    }
-
-    if (vm.count("max-acl-per-pdu")) {
+    if (vm.count("max-acl-per-pdu"))
         _settings._downProfileId = vm["max-acl-per-pdu"].as<unsigned>();
         _settings._downProfileId = vm["max-acl-per-pdu"].as<unsigned>();
-    }
-
-    if (vm.count("data-url")) {
+    if (vm.count("data-url"))
         _settings._dataURL = vm["data-url"].as<std::string>();
         _settings._dataURL = vm["data-url"].as<std::string>();
-    }
+    if (vm.count("script-base"))
+        _settings._scriptBase = vm["script-base"].as<std::string>();
+    if (vm.count("dump-scripts"))
+        _settings._dumpScripts = true;
 }
 
 void SettingsParser::reloadConfig()
 }
 
 void SettingsParser::reloadConfig()