summaryrefslogtreecommitdiff
path: root/decoder/cdec.cc
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-21 20:12:44 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-21 20:12:44 +0000
commitd66f09f1348f9805149b9eab4940cb9c00742984 (patch)
tree3ac00e5359b08d27163a28ed5608953ff6bc589c /decoder/cdec.cc
parent59fdf560bfcb324a08971bbd3c0ebbbb39c6409c (diff)
Score::Clone() via CRTP
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@360 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/cdec.cc')
-rw-r--r--decoder/cdec.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/decoder/cdec.cc b/decoder/cdec.cc
index cc0b1434..6fb6d5a1 100644
--- a/decoder/cdec.cc
+++ b/decoder/cdec.cc
@@ -154,7 +154,7 @@ void InitCommandLine(int argc, char** argv, OracleBleu &ob, po::variables_map* c
ob.AddOptions(&opts);
po::options_description clo("Command line options");
clo.add_options()
- ("config,c", po::value<string>(), "Configuration file")
+ ("config,c", po::value<vector<string> >(), "Configuration file(s) - latest has priority")
("help,h", "Print this help message and exit")
("usage,u", po::value<string>(), "Describe a feature function type")
("compgen", "Print just option names suitable for bash command line completion builtin 'compgen'")
@@ -172,10 +172,14 @@ void InitCommandLine(int argc, char** argv, OracleBleu &ob, po::variables_map* c
}
ShowBanner();
if (conf.count("config")) {
- const string cfg = str("config",conf);
- cerr << "Configuration file: " << cfg << endl;
- ifstream config(cfg.c_str());
- po::store(po::parse_config_file(config, dconfig_options), conf);
+ typedef vector<string> Cs;
+ Cs cs=conf["config"].as<Cs>();
+ for (int i=0;i<cs.size();++i) {
+ string cfg=cs[i];
+ cerr << "Configuration file: " << cfg << endl;
+ ifstream config(cfg.c_str());
+ po::store(po::parse_config_file(config, dconfig_options), conf);
+ }
}
po::notify(conf);