#include "wx/filefn.h"
#endif //WX_PRECOMP
+#include <ctype.h>
+
#include "wx/datetime.h"
#include "wx/cmdline.h"
// types increases, so always use the accessor functions and don't access
// the fields directly!)
- void Check(wxCmdLineParamType typ) const
+ void Check(wxCmdLineParamType WXUNUSED_UNLESS_DEBUG(typ)) const
{
wxASSERT_MSG( type == typ, _T("type mismatch in wxCmdLineOption") );
}
{
// options
wxString m_switchChars; // characters which may start an option
-
bool m_enableLongOptions; // TRUE if long options are enabled
+ wxString m_logo; // some extra text to show in Usage()
// cmd line data
wxArrayString m_arguments; // == argv, argc == m_arguments.GetCount()
}
}
-void wxCmdLineParserData::SetArguments(const wxString& cmdline)
+void wxCmdLineParserData::SetArguments(const wxString& WXUNUSED(cmdline))
{
// either use wxMSW wxApp::ConvertToStandardCommandArgs() or move its logic
// here and use this method from it - but don't duplicate the code
m_data->m_enableLongOptions = enable;
}
+void wxCmdLineParser::SetLogo(const wxString& logo)
+{
+ m_data->m_logo = logo;
+}
+
// ----------------------------------------------------------------------------
// command line construction
// ----------------------------------------------------------------------------
switch ( desc->kind )
{
case wxCMD_LINE_SWITCH:
- AddSwitch(desc->shortName, desc->longName, desc->description);
+ AddSwitch(desc->shortName, desc->longName, desc->description,
+ desc->flags);
break;
case wxCMD_LINE_OPTION:
wxCmdLineParam& param = m_data->m_paramDesc.Last();
wxASSERT_MSG( !(param.flags & wxCMD_LINE_PARAM_MULTIPLE),
- _T("all parameters after the one with "
- "wxCMD_LINE_PARAM_MULTIPLE style will be ignored") );
+ _T("all parameters after the one with wxCMD_LINE_PARAM_MULTIPLE style will be ignored") );
if ( !(flags & wxCMD_LINE_PARAM_OPTIONAL) )
{
wxASSERT_MSG( !(param.flags & wxCMD_LINE_PARAM_OPTIONAL),
- _T("a required parameter can't follow an "
- "optional one") );
+ _T("a required parameter can't follow an optional one") );
}
}
#endif // Debug
if ( *p++ != _T('=') )
{
- wxLogError(_("Option '%s' requires a value, '=' "
- "expected."), name.c_str());
+ wxLogError(_("Option '%s' requires a value, '=' expected."), name.c_str());
ok = FALSE;
}
}
else
{
- wxLogError(_("'%s' is not a correct "
- "numeric value for option "
- "'%s'."),
+ wxLogError(_("'%s' is not a correct numeric value for option '%s'."),
value.c_str(), name.c_str());
ok = FALSE;
const wxChar *res = dt.ParseDate(value);
if ( !res || *res )
{
- wxLogError(_("Option '%s': '%s' cannot "
- "be converted to a date."),
+ wxLogError(_("Option '%s': '%s' cannot be converted to a date."),
name.c_str(), value.c_str());
ok = FALSE;
else
{
wxASSERT_MSG( currentParam == countParam - 1,
- _T("all parameters after the one with "
- "wxCMD_LINE_PARAM_MULTIPLE style "
- "are ignored") );
+ _T("all parameters after the one with wxCMD_LINE_PARAM_MULTIPLE style are ignored") );
// remember that we did have this last repeatable parameter
hadRepeatableParam = TRUE;
}
}
+ if ( !!m_data->m_logo )
+ {
+ wxLogMessage(m_data->m_logo);
+ }
+
wxLogMessage(brief);
wxLogMessage(detailed);
}