[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1205
Date       : Sun May 28 22:28:07 BST 2006

Changed paths:
   M /Trunk/XaraLX/wxOil/camelot.cpp

Fix handling of help command-line option


Diff:
Index: Trunk/XaraLX/wxOil/camelot.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camelot.cpp	(revision 1204)
+++ Trunk/XaraLX/wxOil/camelot.cpp	(revision 1205)
@@ -382,6 +382,7 @@
 		{ wxCMD_LINE_SWITCH, _T("x"), _T("xrccheckgen"), _T("generate xrc.check file") },
 		{ wxCMD_LINE_OPTION, _T("l"), _T("listdebug"), _T("list debug level") , wxCMD_LINE_VAL_NUMBER },
 #endif
+		{ wxCMD_LINE_SWITCH, _T("h"), _T("help"),	_T("Display this help"), wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
 		{ wxCMD_LINE_SWITCH, _T("v"), _T("version"),	_T("Display the version information") },
 		{ wxCMD_LINE_OPTION, _T("r"), _T("resource"),	_T("resource directory") },
 		{ wxCMD_LINE_PARAM, NULL, NULL, _T("input file"), wxCMD_LINE_VAL_STRING, 
@@ -390,7 +391,10 @@
 	};
 	wxCmdLineParser parser(argc,argv);
 	parser.SetDesc(cmdLineDesc);
-	parser.Parse();
+	if (parser.Parse()) // Handles help automatically
+	{
+		return FALSE;
+	}
 
 	wxString ResourceDir = _T("");
 	if (parser.Found(_T("r"), &ResourceDir))
@@ -426,7 +430,7 @@
 
 		camPrintf( strMessage.c_str() );
 		
-		return false;
+		return FALSE;
 	}
 	
 #if defined(_DEBUG)


Xara