show command line help as message box on windows

(cherry picked from commit bd23bf1a2368fa68fe692d451f61bfe3095619bd)
This commit is contained in:
Juergen E. Fischer 2016-09-17 21:42:23 +02:00
parent 59583e97de
commit f61c993e13

View File

@ -106,9 +106,12 @@ typedef SInt32 SRefCon;
/** Print usage text
*/
void usage( std::string const & appName )
void usage( QString appName )
{
std::cerr << "QGIS - " << VERSION << " '" << RELEASE_NAME << "' ("
QStringList msg;
msg
<< "QGIS - " << VERSION << " '" << RELEASE_NAME << "' ("
<< QGSVERSION << ")\n"
<< "QGIS is a user friendly Open Source Geographic Information System.\n"
<< "Usage: " << appName << " [OPTION] [FILE]\n"
@ -134,7 +137,7 @@ void usage( std::string const & appName )
<< "\t[--dxf-symbology-mode none|symbollayer|feature]\tsymbology mode for dxf output\n"
<< "\t[--dxf-scale-denom scale]\tscale for dxf output\n"
<< "\t[--dxf-encoding encoding]\tencoding to use for dxf output\n"
<< "\t[--dxf-preset visiblity-preset]\tlayer map theme to use for dxf output\n"
<< "\t[--dxf-preset maptheme]\tmap theme to use for dxf output\n"
<< "\t[--help]\t\tthis text\n"
<< "\t[--]\t\ttreat all following arguments as FILEs\n\n"
<< " FILE:\n"
@ -146,6 +149,14 @@ void usage( std::string const & appName )
<< " and others supported by OGR and PostgreSQL layers using\n"
<< " the PostGIS extension\n" ; // OK
#ifdef Q_OS_WIN
MessageBox( nullptr,
msg.join( QString() ).toLocal8Bit().constData(),
"QGIS command line options",
MB_OK );
#else
std::cerr << msg.join( QString() ).toLocal8Bit().constData();
#endif
} // usage()
@ -571,7 +582,7 @@ int main( int argc, char *argv[] )
if ( arg == "--help" || arg == "-?" )
{
usage( args[0].toStdString() );
usage( args[0] );
return 2;
}
else if ( arg == "--nologo" || arg == "-n" )