Bug 326449: XULRunner should display a user-visible message when an unknown command-line option or non-existent application.ini file is specified, patch by Nickolay Ponomarev <asqueella@gmail.com>, r=bsmedberg

git-svn-id: svn://10.0.0.236/trunk@189530 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
gavin%gavinsharp.com 2006-02-09 23:17:42 +00:00
parent e7717e810f
commit 73cdf13f1d

View File

@ -141,6 +141,12 @@ static PRBool CheckMaxVersion(const char *versionStr)
/**
* Parse application data.
*
* @returns 0, if the application initialization file was parsed successfully
* and an appropriate Gecko runtime was found.
* 1, if the ini file was missing required fields or an appropriate
* Gecko runtime wasn't found.
* 2, if the specified ini file could not be read.
*/
static int LoadAppData(const char* appDataFile, nsXREAppData* aResult,
nsCString& vendor, nsCString& name, nsCString& version,
@ -513,6 +519,10 @@ int main(int argc, char* argv[])
vendor, name, version, buildID, appID, copyright);
if (!rv)
rv = XRE_main(argc, argv, &appData);
else if (rv == 2)
Output(PR_TRUE, "Error: Unrecognized option specified or couldn't read "
"the application initialization file.\n\n"
"Try `" XULRUNNER_PROGNAME " --help' for more information.\n");
NS_IF_RELEASE(appData.directory);