fixed #12811 - added CLI option --filesdir to show the built-in FILESDIR / added TODOs#7200
Conversation
| void printRaw(const std::string &message) override | ||
| { | ||
| std::cout << message << std::endl; | ||
| std::cout << message << std::endl; // TODO: should not append newline |
There was a problem hiding this comment.
It is a bit of a misnomer right now since it is not raw (it has been an awkward name to begin with) as it adds to it.
I have not changed it because it would have ripple effect beyond the actual change.
|
|
||
| if (std::strcmp(argv[i], "--filesdir") == 0) { | ||
| #ifdef FILESDIR | ||
| mLogger.printRaw(FILESDIR); // TODO: should not include newline |
There was a problem hiding this comment.
This should not include the newline because that means you can simply assign this to a variable but you always have to strip the newline which is extremely annoying in a shell environment.
There was a problem hiding this comment.
It makes sense to me that the newline is added. But maybe the name can be clarified instead.
| " --file-list=<file> Specify the files to check in a text file. Add one\n" | ||
| " filename per line. When file is '-,' the file list will\n" | ||
| " be read from standard input.\n" | ||
| " --filesdir Print the built-in FILESDIR.\n" |
There was a problem hiding this comment.
hmm.. nobody has asked for this as far as I know. why do you add it?
There was a problem hiding this comment.
The interface of some linux tools is not very nice. Lots of options. I don't want to end up with 100's of options.
There was a problem hiding this comment.
hmm.. nobody has asked for this as far as I know.
Most of the issue we uncover have not been reported by the users. Would that be a reason not to fix them.
why do you add it?
Because outside of some debug messages (and that only recently) that path is not visible unless you dump all the strings used in the executable.
Also it is an absolute(!) path hard-coded by the packager(!) which a normal user cannot control.
And see the ticket for more reasoning.
|
|
||
| if (std::strcmp(argv[i], "--filesdir") == 0) { | ||
| #ifdef FILESDIR | ||
| mLogger.printRaw(FILESDIR); // TODO: should not include newline |
There was a problem hiding this comment.
It makes sense to me that the newline is added. But maybe the name can be clarified instead.
If no users are asking for a flag/option then I hesitate to add such flag. I don't understand the purpose still. From the ticket:
what would a regular user want to automate? those files are not supposed to be touched directly by the user. If you use a installation package / package manager you are not supposed to mess up the installed files. The user can build cppcheck without the FILESDIR and install it across multiple platforms. |
|
See conda-forge/cppcheck-feedstock#19 for a case where this would be helpful.
This was actually not possible in all cases until recently. |
300e1eb to
4135743
Compare
|
I feel this is something that should be added to |
Definitely. That's where it will be grouped in when we rework that. |
693e0bc to
3b74b01
Compare
I would prefer that it's not added to |
|
If you remove it from |
Will do. |
Done. |
…LESDIR` / added TODOs
No description provided.