]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/getopt.cpp
Restore the check that list options must take an argument
[libs/core.git] / source / core / getopt.cpp
index e909712a87e7527f35bdad1ca2c148c5f3e6dd0d..fdeb2f8827b2a48075068d153d1cea2597f6ccb1 100644 (file)
@@ -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(); )
        {