Skip to content
Permalink
Browse files

Add usage msg

  • Loading branch information
elpaso committed Jan 20, 2020
1 parent 34b278e commit 44a54b22113b8724835814d9b20ce1210e4467f5
Showing with 18 additions and 4 deletions.
  1. +18 −4 src/server/qgis_mapserver.cpp
@@ -122,11 +122,25 @@ int main( int argc, char *argv[] )
// Override from command line
if ( argc == 2 )
{
QStringList addressAndPort { QString( argv[1] ).split( ':' ) };
if ( addressAndPort.size() == 2 )
const QString arg{ argv[1] };
if ( arg == QStringLiteral( "-h" ) )
{
ipAddress = addressAndPort.at( 0 );
serverPort = addressAndPort.at( 1 );
std::cout << QObject::tr( "Usage: %1 [-h] [ADDRESS:PORT]\n"
"Example: %1 localhost:8000\n\n"
"Default: localhost:8000\n\n"
"The following environment variables can be used:\n"
"QGIS_SERVER_PORT: server port\n"
"QGIS_SERVER_ADDRESS: server address\n" ).arg( basename( argv[0] ) ).toStdString() << std::endl;
exit( 0 );
}
else
{
QStringList addressAndPort { arg.split( ':' ) };
if ( addressAndPort.size() == 2 )
{
ipAddress = addressAndPort.at( 0 );
serverPort = addressAndPort.at( 1 );
}
}
}

0 comments on commit 44a54b2

Please sign in to comment.
You can’t perform that action at this time.