@@ -106,46 +106,57 @@ typedef SInt32 SRefCon;
106
106
107
107
/* * Print usage text
108
108
*/
109
- void usage ( std::string const & appName )
109
+ void usage ( QString appName )
110
110
{
111
- std::cerr << " QGIS - " << VERSION << " '" << RELEASE_NAME << " ' ("
112
- << QGSVERSION << " )\n "
113
- << " QGIS is a user friendly Open Source Geographic Information System.\n "
114
- << " Usage: " << appName << " [OPTION] [FILE]\n "
115
- << " OPTION:\n "
116
- << " \t [--snapshot filename]\t emit snapshot of loaded datasets to given file\n "
117
- << " \t [--width width]\t width of snapshot to emit\n "
118
- << " \t [--height height]\t height of snapshot to emit\n "
119
- << " \t [--lang language]\t use language for interface text\n "
120
- << " \t [--project projectfile]\t load the given QGIS project\n "
121
- << " \t [--extent xmin,ymin,xmax,ymax]\t set initial map extent\n "
122
- << " \t [--nologo]\t hide splash screen\n "
123
- << " \t [--noversioncheck]\t don't check for new version of QGIS at startup\n "
124
- << " \t [--noplugins]\t don't restore plugins on startup\n "
125
- << " \t [--nocustomization]\t don't apply GUI customization\n "
126
- << " \t [--customizationfile]\t use the given ini file as GUI customization\n "
127
- << " \t [--optionspath path]\t use the given QSettings path\n "
128
- << " \t [--configpath path]\t use the given path for all user configuration\n "
129
- << " \t [--authdbdirectory path] use the given directory for authentication database\n "
130
- << " \t [--code path]\t run the given python file on load\n "
131
- << " \t [--defaultui]\t start by resetting user ui settings to default\n "
132
- << " \t [--dxf-export filename.dxf]\t emit dxf output of loaded datasets to given file\n "
133
- << " \t [--dxf-extent xmin,ymin,xmax,ymax]\t set extent to export to dxf\n "
134
- << " \t [--dxf-symbology-mode none|symbollayer|feature]\t symbology mode for dxf output\n "
135
- << " \t [--dxf-scale-denom scale]\t scale for dxf output\n "
136
- << " \t [--dxf-encoding encoding]\t encoding to use for dxf output\n "
137
- << " \t [--dxf-preset visiblity-preset]\t layer visibility preset to use for dxf output\n "
138
- << " \t [--help]\t\t this text\n "
139
- << " \t [--]\t\t treat all following arguments as FILEs\n\n "
140
- << " FILE:\n "
141
- << " Files specified on the command line can include rasters,\n "
142
- << " vectors, and QGIS project files (.qgs): \n "
143
- << " 1. Rasters - supported formats include GeoTiff, DEM \n "
144
- << " and others supported by GDAL\n "
145
- << " 2. Vectors - supported formats include ESRI Shapefiles\n "
146
- << " and others supported by OGR and PostgreSQL layers using\n "
147
- << " the PostGIS extension\n " ; // OK
111
+ QStringList msg;
112
+
113
+ msg
114
+ << " QGIS - " << VERSION << " '" << RELEASE_NAME << " ' ("
115
+ << QGSVERSION << " )\n "
116
+ << " QGIS is a user friendly Open Source Geographic Information System.\n "
117
+ << " Usage: " << appName << " [OPTION] [FILE]\n "
118
+ << " OPTION:\n "
119
+ << " \t [--snapshot filename]\t emit snapshot of loaded datasets to given file\n "
120
+ << " \t [--width width]\t width of snapshot to emit\n "
121
+ << " \t [--height height]\t height of snapshot to emit\n "
122
+ << " \t [--lang language]\t use language for interface text\n "
123
+ << " \t [--project projectfile]\t load the given QGIS project\n "
124
+ << " \t [--extent xmin,ymin,xmax,ymax]\t set initial map extent\n "
125
+ << " \t [--nologo]\t hide splash screen\n "
126
+ << " \t [--noversioncheck]\t don't check for new version of QGIS at startup\n "
127
+ << " \t [--noplugins]\t don't restore plugins on startup\n "
128
+ << " \t [--nocustomization]\t don't apply GUI customization\n "
129
+ << " \t [--customizationfile]\t use the given ini file as GUI customization\n "
130
+ << " \t [--optionspath path]\t use the given QSettings path\n "
131
+ << " \t [--configpath path]\t use the given path for all user configuration\n "
132
+ << " \t [--authdbdirectory path] use the given directory for authentication database\n "
133
+ << " \t [--code path]\t run the given python file on load\n "
134
+ << " \t [--defaultui]\t start by resetting user ui settings to default\n "
135
+ << " \t [--dxf-export filename.dxf]\t emit dxf output of loaded datasets to given file\n "
136
+ << " \t [--dxf-extent xmin,ymin,xmax,ymax]\t set extent to export to dxf\n "
137
+ << " \t [--dxf-symbology-mode none|symbollayer|feature]\t symbology mode for dxf output\n "
138
+ << " \t [--dxf-scale-denom scale]\t scale for dxf output\n "
139
+ << " \t [--dxf-encoding encoding]\t encoding to use for dxf output\n "
140
+ << " \t [--dxf-preset visiblity-preset]\t layer visibility preset to use for dxf output\n "
141
+ << " \t [--help]\t\t this text\n "
142
+ << " \t [--]\t\t treat all following arguments as FILEs\n\n "
143
+ << " FILE:\n "
144
+ << " Files specified on the command line can include rasters,\n "
145
+ << " vectors, and QGIS project files (.qgs): \n "
146
+ << " 1. Rasters - supported formats include GeoTiff, DEM \n "
147
+ << " and others supported by GDAL\n "
148
+ << " 2. Vectors - supported formats include ESRI Shapefiles\n "
149
+ << " and others supported by OGR and PostgreSQL layers using\n "
150
+ << " the PostGIS extension\n " ; // OK
148
151
152
+ #ifdef Q_OS_WIN
153
+ MessageBox ( nullptr ,
154
+ msg.join ( QString () ).toLocal8Bit ().constData (),
155
+ " QGIS command line options" ,
156
+ MB_OK );
157
+ #else
158
+ std::cerr << msg.join ( QString () ).toLocal8Bit ().constData ();
159
+ #endif
149
160
150
161
} // usage()
151
162
@@ -571,7 +582,7 @@ int main( int argc, char *argv[] )
571
582
572
583
if ( arg == " --help" || arg == " -?" )
573
584
{
574
- usage ( args[0 ]. toStdString () );
585
+ usage ( args[0 ] );
575
586
return 2 ;
576
587
}
577
588
else if ( arg == " --nologo" || arg == " -n" )
0 commit comments