summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewermacosx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappviewermacosx.cpp')
-rw-r--r--indra/newview/llappviewermacosx.cpp43
1 files changed, 35 insertions, 8 deletions
diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp
index 2d7091a075..ba3f28911f 100644
--- a/indra/newview/llappviewermacosx.cpp
+++ b/indra/newview/llappviewermacosx.cpp
@@ -36,6 +36,8 @@
#endif
#include "llappviewermacosx.h"
+#include "llcommandlineparser.h"
+
#include "llmemtype.h"
#include "llviewernetwork.h"
@@ -45,6 +47,13 @@
#include "llurldispatcher.h"
#include <Carbon/Carbon.h>
+namespace
+{
+ // The command line args stored.
+ // They are not used immediately by the app.
+ int gArgC;
+ char** gArgV;
+}
int main( int argc, char **argv )
{
@@ -61,14 +70,11 @@ int main( int argc, char **argv )
viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash);
- bool ok = viewer_app_ptr->tempStoreCommandOptions(argc, argv);
- if(!ok)
- {
- llwarns << "Unable to parse command line." << llendl;
- return -1;
- }
-
- ok = viewer_app_ptr->init();
+ // Store off the command line args for use later.
+ gArgC = argc;
+ gArgV = argv;
+
+ bool ok = viewer_app_ptr->init();
if(!ok)
{
llwarns << "Application init failed." << llendl;
@@ -108,6 +114,27 @@ bool LLAppViewerMacOSX::init()
return LLAppViewer::init();
}
+bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp)
+{
+ // First parse the command line, not often used on the mac.
+ clp.parseCommandLine(gArgC, gArgV);
+
+ // Now read in the args from arguments txt.
+ // Succesive calls to clp.parse... will NOT override earlier
+ // options.
+ const char* filename = "arguments.txt";
+ llifstream ifs(filename, llifstream::binary);
+ if (!ifs.is_open())
+ {
+ llwarns << "Unable to open file" << filename << llendl;
+ return false;
+ }
+
+
+ clp.parseCommandLineFile(ifs);
+ return true;
+}
+
void LLAppViewerMacOSX::handleCrashReporting()
{
// Macintosh