X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fgetopt.cpp;h=fdeb2f8827b2a48075068d153d1cea2597f6ccb1;hp=e909712a87e7527f35bdad1ca2c148c5f3e6dd0d;hb=6f0c4c39133e08c05ffb1f1d53141a7e80ba6351;hpb=b27a278d8ab85afbad191d14962cc33e894718d4 diff --git a/source/core/getopt.cpp b/source/core/getopt.cpp index e909712..fdeb2f8 100644 --- a/source/core/getopt.cpp +++ b/source/core/getopt.cpp @@ -21,6 +21,8 @@ GetOpt::OptionImpl &GetOpt::add_option(char s, const string &l, const Store &t, { if(l.empty()) throw invalid_argument("GetOpt::add_option"); + if(t.is_list() && a!=REQUIRED_ARG) + throw invalid_argument("GetOpt::add_option"); for(OptionList::iterator i=opts.begin(); i!=opts.end(); ) {