diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index 90f7a0ad63..6eb4ab8e71 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -951,14 +951,13 @@ void wxCmdLineParser::Usage() wxString wxCmdLineParser::GetUsageString() { wxString appname; - if ( m_data->m_arguments.empty() ) + if ( wxTheApp ) { - if ( wxTheApp ) - appname = wxTheApp->GetAppName(); + appname = wxFileName(wxTheApp->argv[0]).GetFullName(); } - else // use argv[0] + else if (!m_data->m_arguments.empty() ) { - appname = wxFileName(m_data->m_arguments[0]).GetName(); + appname = wxFileName(m_data->m_arguments[0]).GetFullName(); } // we construct the brief cmd line desc on the fly, but not the detailed