--------------1BBB7589C7D50252AD87DC92
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
X-Mozilla-Status2: 00000000
Message-ID: <37671CAE.A2D546C6@wm28.csie.ncu.edu.tw>
Date: Wed, 16 Jun 1999 11:40:30 +0800
From: Ming-I Hsieh <mihs@wm28.csie.ncu.edu.tw>
Organization: WMLab, CSIE, NCU, Taiwan.
X-Mailer: Mozilla 4.6 [en] (X11; I; FreeBSD 3.2-RELEASE i386)
X-Accept-Language: en
MIME-Version: 1.0
To: abiword-dev@abisource.ccom
Subject: Re: How about the argument ``-nosplash'' in ap_UnixApp.cpp
References: <376718F5.A13EAFD5@wm28.csie.ncu.edu.tw>
Content-Type: text/plain; charset=big5
Content-Transfer-Encoding: 7bit
Ming-I Hsieh wrote:
>     337         for (k=nFirstArg; (k<pArgs->m_argc); k++)
>     338         {
>     339                 if (*pArgs->m_argv[k] == '-')
>     340                 {
>     341                         if
> (UT_stricmp(pArgs->m_argv[k],"-nosplash") == 0)
>     342                         {
>     343                                 bShowSplash = UT_FALSE;
>     344                                 break;
>     345                         }
>     346 #if DEBUG
>     347                         else if
> (UT_stricmp(pArgs->m_argv[k],"-splash") == 0)
>     348                         {
>     349                                 // [-splash filename]
>     350                                 szFile = pArgs->m_argv[k+1];
>     351                                 break;
>
> Should we put it to ParseCommandLine?
> Maybe we can remove _showSplash(&Args, szAppName) from
> AP_UnixApp::main(...).
> And let ParseCommandLine call it before return!
>
>     453         pMyUnixApp->ParseCommandLine();
>     454
>     455         _showSplash(&Args, szAppName);
If we use this idea. We can call _showSplash() at end of
ParseCommandLine().
It will be like:    437 struct option longopts[] =
    438 {
    439         {"script",      1, 0, 's'},
    440         {"dumpstrings", 0, 0, 'd'},
    441         {"lib",         1, 0, 'l'},
    442         {"nosplash",    0, 0, 'n'},
    443         {0,             0, 0,  0 }
    444 };
....
    461         UT_Bool bShowSplash = UT_TRUE;
....
    479                         break;
    480                 case 'n':
    481                         bShowSplash = UT_FALSE;
    482                         break;
....
    517         if (pFirstUnixFrame != NULL) {
    518                 if (kWindowsOpened == 0) {
    519                         pFirstUnixFrame->loadDocument(NULL,
IEFT_Unknown);
    520                 } else {
    521                         forgetFrame(pFirstUnixFrame);
    522                         delete pFirstUnixFrame;
    523                 }
    524         }
    525
    526         if (bShowSplash) _showSplash(NULL, NULL);
    527 }
We don't need to pass argvs to _showSplash. So we don't need second time
argv check!
I think this is a better method to handle argv! :)
-- Mihs-I Hsieh
--------------1BBB7589C7D50252AD87DC92--