From eb457f16561188f58274b80efab0ddb5dffa0bb1 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 16 Feb 2011 22:00:30 +0000 Subject: [PATCH] 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 --- src/common/cmdline.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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