View Issue Details

IDProjectCategoryView StatusLast Update
0000723FreeCADBugpublic2012-05-27 19:10
Reportershoogen Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
Product Version0.12 
Fixed in Version0.13 
Summary0000723: improper handling of qt specific comand line arguments
DescriptionFreeCAD does not skip command line arguments that are handled by qt.
$ FreeCAD -style motif
File format not supported: motif
TagsNo tags attached.
FreeCAD Information

Activities

wmayer

2012-05-27 15:48

administrator   ~0002085

If you write FreeCAD -style=motif then the above warning won't arise. The problem is that the boost program options library doesn't support to omit the '=' for the long version of an option. So, what it supports is for example this:
FreeCAD --user-cfg=Path_to_cfg_file or
FreeCAD -u Path_to_cfg_file but not
FreeCAD --user-cfg Path_to_cfg_file

In the last case it always handles the Path_to_cfg_file argument as a so called positional argument and in FreeCAD the positional argument is the hidden option "input-file".

So, after all I think the only workaround is to replace strings like "-style " with "-style=". Then the boost library should work as expected.

shoogen

2012-05-27 17:08

developer   ~0002086

Last edited: 2012-05-27 17:10

I thought that qt offers a method to handle the command line options, that takes care of the options not designated for the main program logic.
(QStringList QCoreApplication::arguments())

http://stackoverflow.com/questions/870258/command-line-parser-for-qt4

wmayer

2012-05-27 19:09

administrator   ~0002088

But that's not a Qt issue. In FreeCAD App we already parse the command line parameters and because of "-style Windows" boost assumes that "style" has no parameters and thus handles "Windows" as filename.

And all this is done before creating the QApplication instance. In the meantime I have found a nice working solution.

wmayer

2012-05-27 19:10

administrator   ~0002089

git show ffb5cba

Issue History

Date Modified Username Field Change
2012-05-25 05:57 shoogen New Issue
2012-05-27 15:48 wmayer Note Added: 0002085
2012-05-27 17:08 shoogen Note Added: 0002086
2012-05-27 17:10 shoogen Note Edited: 0002086
2012-05-27 19:09 wmayer Note Added: 0002088
2012-05-27 19:10 wmayer Note Added: 0002089
2012-05-27 19:10 wmayer Status new => closed
2012-05-27 19:10 wmayer Resolution open => fixed
2012-05-27 19:10 wmayer Fixed in Version => 0.13