]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/cmdline.cpp
not necessary anymore
[wxWidgets.git] / src / common / cmdline.cpp
index 1c74dfdb5ecdb3ad65d7f0aff6da1f6ee4dfba32..524ee1f43a1875b6964bee92fa2636da42eb1d92 100644 (file)
@@ -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() );