Go to the documentation of this file.
21 #ifndef __SSRC_WISP_UTILITY_SERVICE_MAIN_OPTIONS_H
22 #define __SSRC_WISP_UTILITY_SERVICE_MAIN_OPTIONS_H
31 boost::program_options::options_description _custom_description;
39 using namespace boost::program_options;
41 _custom_description.add_options()
42 (
"config,f", value<std::vector<std::string> >()->composing(),
43 "Specify a configuration file from which to read additional options.")
45 "Print Wisp version with which the service was compiled.");
50 virtual void notify(boost::program_options::variables_map & vm) {
51 namespace po = boost::program_options;
53 if(vm.count(
"config") > 0) {
54 std::vector<std::string> config =
55 vm.find(
"config")->second.as<std::vector<std::string> >();
57 for(std::vector<std::string>::iterator file = config.begin(); file != config.end(); ++file) {
58 std::ifstream ifs(file->c_str());
61 po::store(po::parse_config_file(ifs,
description), vm);
63 throw std::invalid_argument(*file);
Copyright © 2006-2012 Savarese Software Research Corporation. All rights reserved.
Copyright © 2017 Savarese Software Research Corporation. All rights reserved