From efd75d66af423a3bfe1e2814b41acf50b97fe48a Mon Sep 17 00:00:00 2001 From: "gavin%gavinsharp.com" Date: Thu, 9 Feb 2006 23:17:42 +0000 Subject: [PATCH] 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 , r=bsmedberg --- xulrunner/app/nsXULRunnerApp.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xulrunner/app/nsXULRunnerApp.cpp b/xulrunner/app/nsXULRunnerApp.cpp index 3f26a831a9f5..e3b65b7414d2 100644 --- a/xulrunner/app/nsXULRunnerApp.cpp +++ b/xulrunner/app/nsXULRunnerApp.cpp @@ -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);