214{
215 bool showUsage = false;
216
218
219
220 bool nextIsErrorReportFile = false;
221 bool nextIsExtractImageOnly = false;
222 bool nextIsFileCmdScript = false;
223
224
225 isDebug = false;
226 isDropRegression = false;
227 isReset = false;
228 errorReportFile = "";
229 fileCmdScriptFile = "";
230 isErrorReportRegressionTest = false;
231 isGnuplot = false;
232 isExportOnly = false;
233 isExtractImageOnly = false;
234 extractImageOnlyExtension = "";
235 isUpgrade = false;
236
237 for (int i = 1; i < argc; i++) {
238
239 bool isLoadStartupFile = false;
240
241 if (nextIsErrorReportFile) {
243 argv [i],
244 QObject::tr ("is not a valid file name"));
245 errorReportFile = argv [i];
246 nextIsErrorReportFile = false;
247 } else if (nextIsExtractImageOnly) {
249 argv [i],
250 QObject::tr ("is not a valid image file extension"));
251 extractImageOnlyExtension = argv [i];
252 nextIsExtractImageOnly = false;
253 } else if (nextIsFileCmdScript) {
255 argv [i],
256 QObject::tr ("is not a valid file name"));
257 fileCmdScriptFile = argv [i];
258 nextIsFileCmdScript = false;
259 }
else if (strcmp (argv [i],
DASH_DEBUG.toLatin1().data()) == 0) {
260 isDebug = true;
262 isDropRegression = true;
264 nextIsErrorReportFile = true;
266 isExportOnly = true;
268 isExtractImageOnly = true;
269 nextIsExtractImageOnly = true;
271 nextIsFileCmdScript = true;
272 }
else if (strcmp (argv [i],
DASH_GNUPLOT.toLatin1().data()) == 0) {
273 isGnuplot = true;
274 }
else if (strcmp (argv [i],
DASH_HELP.toLatin1().data()) == 0) {
275 showUsage = true;
276 }
else if (strcmp (argv [i],
DASH_REGRESSION.toLatin1().data()) == 0) {
277 isErrorReportRegressionTest = true;
278 }
else if (strcmp (argv [i],
DASH_RESET.toLatin1().data()) == 0) {
279 isReset = true;
280 }
else if (strcmp (argv [i],
DASH_STYLE.toLatin1().data()) == 0) {
281
282
283 }
else if (strcmp (argv [i],
DASH_STYLES.toLatin1().data()) == 0) {
285 }
else if (strcmp (argv [i],
DASH_UPGRADE.toLatin1().data()) == 0) {
286 isUpgrade = true;
287 }
else if (strncmp (argv [i],
DASH.toLatin1().data(), 1) == 0) {
288 showUsage = true;
289 } else {
290
291
292 QString fileName = argv [i];
293 QFileInfo fInfo (fileName);
294 if (fInfo.isRelative() && !fileName.startsWith ("http")) {
295 fileName = fInfo.absoluteFilePath();
296 }
297
298 isLoadStartupFile = true;
299 loadStartupFiles << fileName;
300 }
301
302
303 if (!isLoadStartupFile) {
304 commandLineWithoutLoadStartupFiles << argv [i];
305 }
306 }
307
308
311 errorReportFile,
312 fileCmdScriptFile,
313 loadStartupFiles);
316 errorReportFile,
317 fileCmdScriptFile,
318 loadStartupFiles);
319
320
321 if (showUsage || nextIsErrorReportFile || nextIsExtractImageOnly || nextIsFileCmdScript) {
322
324
325 }
326}
Provides list of file extensions for import.
bool offers(const QString &fileExtension) const
Return true if specified file extension is supported.
void sanityCheckLoadStartupFiles(bool isRepeatingFlag, const QString &dashForRepeatingFlag, const QString &errorReportFile, const QString &fileCmdScriptFile, const QStringList &loadStartupFiles)
const QString DASH_ERROR_REPORT("-"+CMD_ERROR_REPORT)
const QString DASH_GNUPLOT("-"+CMD_GNUPLOT)
const QString DASH_EXTRACT_IMAGE_ONLY("-"+CMD_EXTRACT_IMAGE_ONLY)
void sanityCheckValue(bool requiredCondition, const QString &arg, const QString &msgUnadorned)
const QString DASH_HELP("-"+CMD_HELP)
const QString DASH_UPGRADE("-"+CMD_UPGRADE)
const QString DASH_RESET("-"+CMD_RESET)
const QString DASH_STYLES("-"+CMD_STYLES)
const QString DASH_REGRESSION("-"+CMD_REGRESSION)
const QString DASH_EXPORT_ONLY("-"+CMD_EXPORT_ONLY)
const QString DASH_DROP_REGRESSION("-"+CMD_DROP_REGRESSION)
const QString DASH_DEBUG("-"+CMD_DEBUG)
const QString DASH_STYLE("-"+CMD_STYLE)
bool checkFileExists(const QString &file)
const QString DASH_FILE_CMD_SCRIPT("-"+CMD_FILE_CMD_SCRIPT)