some CmdLineParser-related cleanups#7105
Conversation
|
I filed https://trac.cppcheck.net/ticket/13431 about consolidating the XML CLI options. |
9a0ad07 to
2608caf
Compare
|
I filed tickets about the missing CLI options: |
| * Check code in the headers, this is on by default but can | ||
| * be turned off to save CPU */ | ||
| bool checkHeaders = true; | ||
| bool checkHeaders = true; // TODO: CLI |
There was a problem hiding this comment.
Well I did have a intention here. My idea was to only provide certain advanced options in the GUI. In an effort to keep the command line options simple.
It's a good thing if options are available on the command line.
It's a bad thing that the command line is "bloated".
There was a problem hiding this comment.
Well I did have a intention here. My idea was to only provide certain advanced options in the GUI. In an effort to keep the command line options simple.
Since this is a GUI project option it would be good to have an CLI option so you could override it since the project file might be immutable. Although CLI and GUI projects do not play well with each other at the moment - see https://trac.cppcheck.net/ticket/12918.
It's a good thing if options are available on the command line.
It's a bad thing that the command line is "bloated".
Well - that's kind of the point of a CLI - it should allow you to automate things all things you could do in the GUI. It also makes writing tests easier since you do not require to generate a project file.
There was a problem hiding this comment.
you can set the option in the gui project file though so you CAN use the cli and automate all things. It's a XML format file so not hard to write.
There was a problem hiding this comment.
I think something like ffmpeg is an example of where I don't want to end up:
https://gist.github.com/tayvano/6e2d456a9897f55025e25035478a3a50
There was a problem hiding this comment.
you can set the option in the gui project file though so you CAN use the cli and automate all things. It's a XML format file so not hard to write.
The GUI project is inferior to the CLI. It is not documented. It only has a subset of the CLI options. The handling is different or just missing because that logic lives in the CmdLineParser or the GUI description.
For this to work properly it would require a rework. The easiest way would be to treat it more like a front-end than a GUI by generating CLI options which are then fed to the CmdLineParser. This would actually simplify a lot of things and probably get rid of a lot of duplicated (and possibly untested) code.
There was a problem hiding this comment.
but we also have some which we probably do not need to have
do you have some in mind? spontanously I am personally thinking about the --rule.
I would like to get rid of extra flags. What is a good approach for that. I am thinking that we could at least hide such options so they are not shown in --help output anymore.
There was a problem hiding this comment.
I think we could easily come up with 100 options that could benefit some users. If we add those to cppcheck it will become a user-unfriendly tool.
Could we provide "basic flags" and "advanced flags" somehow. If "basic flags" are fully visible in the normal help output but the "advanced flags" are not in the normal help but somehow the user can see those..
Do you know if some tool has such "advanced flags" how does it expose those?
How about only "basic flags" is written if you write "--help". And the --help output could say that "advanced options can be seen if you use --help-all" or something like that?
There was a problem hiding this comment.
Do you know if some tool has such "advanced flags" how does it expose those?
Yes. Several do that. They usually have a note in the output that you get more information if you pass a different flag. So --help-all would make sense.
It would make sense if we try to rework that with also moving the actual documentation of the options out of the source file so we can generate the manpage from it as well. There is a ticket about it but I did not find it right now.
There was a problem hiding this comment.
Can we merge this? This does not introduce any new CLI options yet and there are several follow-ups being held up.
There was a problem hiding this comment.
For this to work properly it would require a rework. The easiest way would be to treat it more like a front-end than a GUI by generating CLI options which are then fed to the
CmdLineParser. This would actually simplify a lot of things and probably get rid of a lot of duplicated (and possibly untested) code.
I filed https://trac.cppcheck.net/ticket/13623 for tracking this.
How about only "basic flags" is written if you write "--help". And the --help output could say that "advanced options can be seen if you use --help-all" or something like that?
I filed https://trac.cppcheck.net/ticket/13624 for tracking this.
danmar
left a comment
There was a problem hiding this comment.
sorry it took so long for the approval.
No description provided.