diff options
author | Matthias Huetsch [mhu] <matthias.huetsch@oracle.com> | 2010-12-10 08:38:05 +0100 |
---|---|---|
committer | Matthias Huetsch [mhu] <matthias.huetsch@oracle.com> | 2010-12-10 08:38:05 +0100 |
commit | 232c0fb700efd31eff8cfee896437c481582ed0f (patch) | |
tree | e74e9acfcd2e630ec50017afed25164d01f944ce /idlc/source/idlcmain.cxx | |
parent | 6c48a64f2616d1bd0ba9cf9610fd53fc359e1270 (diff) |
#115784# idlc: fixed commandline option processing.
Diffstat (limited to 'idlc/source/idlcmain.cxx')
-rw-r--r-- | idlc/source/idlcmain.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/idlc/source/idlcmain.cxx b/idlc/source/idlcmain.cxx index 006131f727df..6e3af1baca73 100644 --- a/idlc/source/idlcmain.cxx +++ b/idlc/source/idlcmain.cxx @@ -34,19 +34,25 @@ using namespace ::rtl; SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { - Options options; + std::vector< std::string > args; + for (int i = 1; i < argc; i++) + { + if (!Options::checkArgument (args, argv[i], strlen(argv[i]))) + return (1); + } + Options options(argv[0]); try { - if (!options.initOptions(argc, argv)) - exit(1); + if (!options.initOptions(args)) + return (0); } catch( IllegalArgument& e) { fprintf(stderr, "Illegal argument: %s\n%s", e.m_message.getStr(), options.prepareVersion().getStr()); - exit(99); + return (99); } setIdlc(&options); |