216{
217 bool showUsage = false;
218
220
221
222 bool nextIsErrorReportFile = false;
223 bool nextIsExtractImageOnly = false;
224 bool nextIsFileCmdScript = false;
225
226
227 isDebug = false;
228 isDropRegression = false;
229 isReset = false;
230 errorReportFile = "";
231 fileCmdScriptFile = "";
232 isErrorReportRegressionTest = false;
233 isGnuplot = false;
234 isExportOnly = false;
235 isExtractImageOnly = false;
236 extractImageOnlyExtension = "";
237 isUpgrade = false;
238
239 for (int i = 1; i < argc; i++) {
240
241 bool isLoadStartupFile = false;
242
243 if (nextIsErrorReportFile) {
245 argv [i],
246 QObject::tr ("is not a valid file name"));
247 errorReportFile = argv [i];
248 nextIsErrorReportFile = false;
249 } else if (nextIsExtractImageOnly) {
251 argv [i],
252 QObject::tr ("is not a valid image file extension"));
253 extractImageOnlyExtension = argv [i];
254 nextIsExtractImageOnly = false;
255 } else if (nextIsFileCmdScript) {
257 argv [i],
258 QObject::tr ("is not a valid file name"));
259 fileCmdScriptFile = argv [i];
260 nextIsFileCmdScript = false;
261 }
else if (strcmp (argv [i],
DASH_DEBUG.toLatin1().data()) == 0) {
262 isDebug = true;
264 isDropRegression = true;
266 nextIsErrorReportFile = true;
268 isExportOnly = true;
270 isExtractImageOnly = true;
271 nextIsExtractImageOnly = true;
273 nextIsFileCmdScript = true;
274 }
else if (strcmp (argv [i],
DASH_GNUPLOT.toLatin1().data()) == 0) {
275 isGnuplot = true;
276 }
else if (strcmp (argv [i],
DASH_HELP.toLatin1().data()) == 0) {
277 showUsage = true;
278 }
else if (strcmp (argv [i],
DASH_REGRESSION.toLatin1().data()) == 0) {
279 isErrorReportRegressionTest = true;
280 }
else if (strcmp (argv [i],
DASH_RESET.toLatin1().data()) == 0) {
281 isReset = true;
282 }
else if (strcmp (argv [i],
DASH_STYLE.toLatin1().data()) == 0) {
283
284
285 }
else if (strcmp (argv [i],
DASH_STYLES.toLatin1().data()) == 0) {
287 }
else if (strcmp (argv [i],
DASH_UPGRADE.toLatin1().data()) == 0) {
288 isUpgrade = true;
289 }
else if (strncmp (argv [i],
DASH.toLatin1().data(), 1) == 0) {
290 showUsage = true;
291 } else {
292
293
294 QString fileName = argv [i];
295 QFileInfo fInfo (fileName);
296 if (fInfo.isRelative() && !fileName.startsWith ("http")) {
297 fileName = fInfo.absoluteFilePath();
298 }
299
300 isLoadStartupFile = true;
301 loadStartupFiles << fileName;
302 }
303
304
305 if (!isLoadStartupFile) {
306 commandLineWithoutLoadStartupFiles << argv [i];
307 }
308 }
309
310
313 errorReportFile,
314 fileCmdScriptFile,
315 loadStartupFiles);
318 errorReportFile,
319 fileCmdScriptFile,
320 loadStartupFiles);
321
322
323 if (showUsage || nextIsErrorReportFile || nextIsExtractImageOnly || nextIsFileCmdScript) {
324
326
327 }
328}
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)