diff options
| author | Mark Palange <palange@lindenlab.com> | 2008-03-14 23:21:38 +0000 |
|---|---|---|
| committer | Mark Palange <palange@lindenlab.com> | 2008-03-14 23:21:38 +0000 |
| commit | 04611efae8a3291ceba8a29dd920bdae0d404830 (patch) | |
| tree | 43966566a1eeb42cf546a638310348f0585fc395 /indra/newview/llappviewermacosx.cpp | |
| parent | c0c5bdbbb90e0bcdab558ec22ea352c9d08dc078 (diff) | |
[NOTE: This was an erroneous commit, and was reverted in the next revision]
QAR-369 - viewer-cleanup2-7 81916 merged into release.
Diffstat (limited to 'indra/newview/llappviewermacosx.cpp')
| -rw-r--r-- | indra/newview/llappviewermacosx.cpp | 43 |
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 |
