diff options
Diffstat (limited to 'rsc/source/prj/start.cxx')
-rw-r--r-- | rsc/source/prj/start.cxx | 88 |
1 files changed, 59 insertions, 29 deletions
diff --git a/rsc/source/prj/start.cxx b/rsc/source/prj/start.cxx index c43879020a8e..df4ce12200c5 100644 --- a/rsc/source/prj/start.cxx +++ b/rsc/source/prj/start.cxx @@ -56,6 +56,7 @@ #endif // UNX #include <rsctools.hxx> +#include <rscerror.h> #include <tools/fsys.hxx> /*************** C O D E ************************************************/ @@ -111,25 +112,38 @@ static BOOL CallPrePro( const ByteString& rPrePro, if( !fRspFile ) aNewCmdL.Append( rsc_strdup( rPrePro.GetBuffer() ) ); - for( i = 1; i < int(pCmdLine->GetCount() -1); i++ ){ - if( !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-u", 2 ) - || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-i", 2 ) - || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-d", 2 ) ) + + bool bVerbose = false; + for( i = 1; i < int(pCmdLine->GetCount() -1); i++ ) + { + if ( 0 == rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-verbose" ) ) + { + bVerbose = true; + continue; + } + if ( !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-u", 2 ) + || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-i", 2 ) + || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-d", 2 ) + ) { aNewCmdL.Append( rsc_strdup( (char *)pCmdLine->GetEntry( i ) ) ); } - }; + } + aNewCmdL.Append( rsc_strdup( rInput.GetBuffer() ) ); aNewCmdL.Append( rsc_strdup( rOutput.GetBuffer() ) ); aNewCmdL.Append( (void *)0 ); - printf( "Preprocessor commandline: " ); - for( i = 0; i < (int)(pCmdL->GetCount() -1); i++ ) + if ( bVerbose ) { - printf( " " ); - printf( "%s", (const char *)pCmdL->GetEntry( i ) ); + printf( "Preprocessor commandline: " ); + for( i = 0; i < (int)(pCmdL->GetCount() -1); i++ ) + { + printf( " " ); + printf( "%s", (const char *)pCmdL->GetEntry( i ) ); + } + printf( "\n" ); } - printf( "\n" ); if( fRspFile ) { @@ -150,13 +164,16 @@ static BOOL CallPrePro( const ByteString& rPrePro, } fclose( fRspFile ); - printf( "Preprocessor startline: " ); - for( i = 0; i < (int)(pCmdL->GetCount() -1); i++ ) + if ( bVerbose ) { - printf( " " ); - printf( "%s", (const char *)pCmdL->GetEntry( i ) ); + printf( "Preprocessor startline: " ); + for( i = 0; i < (int)(pCmdL->GetCount() -1); i++ ) + { + printf( " " ); + printf( "%s", (const char *)pCmdL->GetEntry( i ) ); + } + printf( "\n" ); } - printf( "\n" ); } #if ((defined OS2 || defined WNT) && (defined TCPP || defined tcpp)) || defined UNX || defined OS2 @@ -194,7 +211,6 @@ static BOOL CallRsc2( ByteString aRsc2Name, ByteString aSrsName, RscPtrPtr * pCmdLine ) { - RscPtrPtr aNewCmdL; // Kommandozeile int i, nExit; ByteString* pString; ByteString aRspFileName; // Response-Datei @@ -203,21 +219,21 @@ static BOOL CallRsc2( ByteString aRsc2Name, aRspFileName = ::GetTmpFileName(); fRspFile = fopen( aRspFileName.GetBuffer(), "w" ); - printf( "Rsc2 commandline: " ); - aNewCmdL.Append( rsc_strdup( aRsc2Name.GetBuffer() ) ); - printf( "%s", (const char *)aNewCmdL.GetEntry( aNewCmdL.GetCount() -1 ) ); - printf( " " ); - ByteString aTmpStr( '@' ); - aTmpStr += aRspFileName; - aNewCmdL.Append( rsc_strdup( aTmpStr.GetBuffer() ) ); - printf( "%s", (const char *)aNewCmdL.GetEntry( aNewCmdL.GetCount() -1 ) ); - aNewCmdL.Append( (void *)0 ); - printf( "\n" ); - + RscVerbosity eVerbosity = RscVerbosityNormal; if( fRspFile ) { for( i = 1; i < (int)(pCmdLine->GetCount() -1); i++ ) { + if ( !rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-verbose" ) ) + { + eVerbosity = RscVerbosityVerbose; + continue; + } + if ( !rsc_stricmp( (char *)pCmdLine->GetEntry( i ), "-quiet" ) ) + { + eVerbosity = RscVerbositySilent; + continue; + } if( !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-fp=", 4 ) || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-fo=", 4 ) || !rsc_strnicmp( (char *)pCmdLine->GetEntry( i ), "-pp=", 4 ) @@ -261,6 +277,22 @@ static BOOL CallRsc2( ByteString aRsc2Name, fclose( fRspFile ); }; + RscPtrPtr aNewCmdL; // Kommandozeile + aNewCmdL.Append( rsc_strdup( aRsc2Name.GetBuffer() ) ); + ByteString aTmpStr( '@' ); + aTmpStr += aRspFileName; + aNewCmdL.Append( rsc_strdup( aTmpStr.GetBuffer() ) ); + aNewCmdL.Append( (void *)0 ); + + if ( eVerbosity >= RscVerbosityVerbose ) + { + printf( "Rsc2 commandline: " ); + printf( "%s", (const char *)aNewCmdL.GetEntry( 0 ) ); + printf( " " ); + printf( "%s", (const char *)aNewCmdL.GetEntry( 1 ) ); + printf( "\n" ); + } + #if ((defined OS2 || defined WNT) && (defined TCPP || defined tcpp)) || defined UNX || defined OS2 nExit = spawnvp( P_WAIT, aRsc2Name.GetBuffer(), (char* const*)aNewCmdL.GetBlock() ); #elif defined CSET @@ -328,8 +360,6 @@ int cdecl main ( int argc, char ** argv) aRsc2Name += aDelim; aRsc2Name += ByteString("rsc2"); - printf( "VCL Resource Compiler 3.0\n" ); - pStr = ::ResponseFile( &aCmdLine, argv, argc ); if( pStr ) { |