X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/47608cc18460f3977111085222f1e8ec504f015c..dbb88122c9b22aa02f8840d3bf92007781d11f25:/src/common/cmdline.cpp?ds=sidebyside diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index a8764a296f..29399558f5 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -98,7 +98,7 @@ struct wxCmdLineOption void SetDateVal(const wxDateTime val) { Check(wxCMD_LINE_VAL_DATE); m_dateVal = val; m_hasVal = TRUE; } - void SetHasValue() { m_hasVal = TRUE; } + void SetHasValue(bool hasValue = TRUE) { m_hasVal = hasValue; } bool HasValue() const { return m_hasVal; } public: @@ -475,6 +475,18 @@ wxString wxCmdLineParser::GetParam(size_t n) const return m_data->m_parameters[n]; } +// Resets switches and options +void wxCmdLineParser::Reset() +{ + unsigned int i; + for (i = 0; i < m_data->m_options.Count(); i++) + { + wxCmdLineOption& opt = m_data->m_options[(size_t)i]; + opt.SetHasValue(FALSE); + } +} + + // ---------------------------------------------------------------------------- // the real work is done here // ---------------------------------------------------------------------------- @@ -490,6 +502,8 @@ int wxCmdLineParser::Parse() size_t countParam = m_data->m_paramDesc.GetCount(); + Reset(); + // parse everything wxString arg; size_t count = m_data->m_arguments.GetCount();