mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-05 00:09:32 -04:00
add command line arguments on windows
git-svn-id: http://svn.osgeo.org/qgis/trunk@11166 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
fe1e324360
commit
3c01031b16
@ -75,7 +75,6 @@ typedef SInt32 SRefCon;
|
||||
|
||||
static const char * const ident_ = "$Id$";
|
||||
|
||||
#ifndef WIN32
|
||||
/** print usage text
|
||||
*/
|
||||
void usage( std::string const & appName )
|
||||
@ -102,7 +101,6 @@ void usage( std::string const & appName )
|
||||
|
||||
|
||||
} // usage()
|
||||
#endif
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user