X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/74698d3a22d5e611bbcd731a3ade616c66cfaca6..44ba8f0ea92f65d9893ce0780971745a5d8e80ea:/src/common/cmdline.cpp diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index 1c74dfdb5e..524ee1f43a 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -808,9 +808,17 @@ int wxCmdLineParser::Parse(bool showUsage) } else { - optName.Printf(_("%s (or %s)"), - opt.shortName.c_str(), - opt.longName.c_str()); + if ( AreLongOptionsEnabled() ) + { + optName.Printf( _("%s (or %s)"), + opt.shortName.c_str(), + opt.longName.c_str() ); + } + else + { + optName.Printf( wxT("%s"), + opt.shortName.c_str() ); + } } errorMsg << wxString::Format(_("The value for the option '%s' must be specified."), @@ -842,10 +850,11 @@ int wxCmdLineParser::Parse(bool showUsage) } } - if ( !ok && errorMsg.length() != 0 ) + if ( !ok && (errorMsg.length() != 0 || helpRequested) ) { wxString usage; wxMessageOutput* msgOut = wxMessageOutput::Get(); + wxASSERT(msgOut); if ( showUsage ) usage = GetUsageString(); if ( msgOut ) msgOut->Printf( wxT("%s%s"), usage.c_str(), errorMsg.c_str() );