diff options
author | Ulrich Germann <ugermann@inf.ed.ac.uk> | 2015-03-12 02:32:06 +0300 |
---|---|---|
committer | Ulrich Germann <ugermann@inf.ed.ac.uk> | 2015-03-12 02:32:06 +0300 |
commit | a49b76be3fdf5710460d421e9bf9344ca36b00e3 (patch) | |
tree | 6d9073ec994305f46a2c33dbdcdb024abb93b9b5 /moses/Parameter.cpp | |
parent | 530d0f5a11e5f1b2ab11d7f0bfa080a0c2134dd9 (diff) |
Quick hack to make moses not stumble over double-dash parameter specifications.
Diffstat (limited to 'moses/Parameter.cpp')
-rw-r--r-- | moses/Parameter.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/moses/Parameter.cpp b/moses/Parameter.cpp index 00e3ec253..e43c69d22 100644 --- a/moses/Parameter.cpp +++ b/moses/Parameter.cpp @@ -422,8 +422,18 @@ LoadParam(const string &filePath) /** load all parameters from the configuration file and the command line switches */ bool Parameter:: -LoadParam(int argc, char* argv[]) +LoadParam(int argc, char* xargv[]) { + // legacy parameter handling: all parameters are expected + // to start with a single dash + char* argv[argc+1]; + for (int i = 0; i < argc; ++i) + { + argv[i] = xargv[i]; + if (strlen(argv[i]) > 2 && argv[i][0] == '-' && argv[i][1] == '-') + ++argv[i]; + } + // config file (-f) arg mandatory string configPath; if ( (configPath = FindParam("-f", argc, argv)) == "" |