X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fcore%2Fgetopt.cpp;h=cbc0afb0d76e9d5eec8f79e4a835d1cf01ff7700;hb=HEAD;hp=6f7b1f807c9d719d3829959db91370860a62fabe;hpb=44da9fc9afb6b7e49c1558c5572213a1e6f401e8;p=libs%2Fcore.git diff --git a/source/core/getopt.cpp b/source/core/getopt.cpp index 6f7b1f8..cbc0afb 100644 --- a/source/core/getopt.cpp +++ b/source/core/getopt.cpp @@ -6,8 +6,7 @@ using namespace std; namespace Msp { -GetOpt::GetOpt(): - help(false) +GetOpt::GetOpt() { add_option("help", help, NO_ARG).set_help("Displays this help"); } @@ -32,7 +31,7 @@ GetOpt::OptionImpl &GetOpt::add_option(char s, const string &l, const Store &t, if((s!=0 && (*i)->get_short()==s) || (*i)->get_long()==l) { delete *i; - opts.erase(i++); + i = opts.erase(i); } else ++i; @@ -318,9 +317,6 @@ GetOpt::OptionImpl::OptionImpl(char s, const string &l, const Store &t, ArgType shrt(s), lng(l), arg_type(a), - seen_count(0), - ext_seen_count(0), - metavar("ARG"), store(t.clone()) { }