-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed #12811 - added CLI option --filesdir
to show the built-in FILESDIR
/ added TODOs
#7200
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -422,11 +422,18 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a | |
return Result::Exit; | ||
} | ||
|
||
if (std::strcmp(argv[i], "--filesdir") == 0) { | ||
#ifdef FILESDIR | ||
mLogger.printRaw(FILESDIR); // TODO: should not include newline | ||
#endif | ||
return Result::Exit; | ||
} | ||
|
||
if (std::strcmp(argv[i], "--version") == 0) { | ||
if (!loadCppcheckCfg()) | ||
return Result::Fail; | ||
const std::string version = getVersion(); | ||
mLogger.printRaw(version); | ||
mLogger.printRaw(version); // TODO: should not include newline | ||
return Result::Exit; | ||
} | ||
} | ||
|
@@ -1727,6 +1734,7 @@ void CmdLineParser::printHelp() const | |
" --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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm.. nobody has asked for this as far as I know. why do you add it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Most of the issue we uncover have not been reported by the users. Would that be a reason not to fix them.
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. |
||
" -f, --force Force checking of all configurations in files. If used\n" | ||
" together with '--max-configs=', the last option is the\n" | ||
" one that is effective.\n" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -241,7 +241,7 @@ namespace { | |
|
||
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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is a bit of a misnomer right now since it is not I have not changed it because it would have ripple effect beyond the actual change. |
||
} | ||
}; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense to me that the newline is added. But maybe the name can be clarified instead.