Applied #12549: command line usage correction

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@66920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2011-02-16 22:00:30 +00:00
parent 8d91f5cacc
commit eb457f1656

View File

@@ -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