Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add command line arguments on windows
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11166 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jul 24, 2009
1 parent e7bc85e commit 8d6fed8
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions src/app/main.cpp
Expand Up @@ -75,7 +75,6 @@ typedef SInt32 SRefCon;

static const char * const ident_ = "$Id$";

#ifndef WIN32
/** print usage text
*/
void usage( std::string const & appName )
Expand All @@ -102,7 +101,6 @@ void usage( std::string const & appName )


} // usage()
#endif


/////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -362,10 +360,33 @@ int main( int argc, char *argv[] )
#else
for ( int i = 1; i < argc; i++ )
{
#ifdef QGISDEBUG
QgsDebugMsg( QString( "%1: %2" ).arg( i ).arg( argv[i] ) );
#endif
myFileList.append( QDir::convertSeparators( QFileInfo( QFile::decodeName( argv[i] ) ).absoluteFilePath() ) );
QString arg = argv[i];

if ( arg == "--help" || arg == "-h" || arg == "-?" )
{
usage( argv[0] );
return 2;
}
else if ( i + 1 < argc && ( arg == "--snapshot" || arg == "-s" ) )
{
mySnapshotFileName = QDir::convertSeparators( QFileInfo( QFile::decodeName( argv[++i] ) ).absoluteFilePath() );
}
else if ( i + 1 < argc && ( arg == "--lang" || arg == "-l" ) )
{
myTranslationCode = argv[++i];
}
else if ( i + 1 < argc && ( arg == "--project" || arg == "-p" ) )
{
myProjectFileName = QDir::convertSeparators( QFileInfo( QFile::decodeName( argv[++i] ) ).absoluteFilePath() );
}
else if ( i + 1 < argc && ( arg == "--extent" || arg == "-e" ) )
{
myInitialExtent = argv[++i];
}
else
{
myFileList.append( QDir::convertSeparators( QFileInfo( QFile::decodeName( argv[i] ) ).absoluteFilePath() ) );
}
}
#endif //WIN32

Expand Down

0 comments on commit 8d6fed8

Please sign in to comment.