fixed #12045 - print error when using an option which has not been compiled in instead of treating it as non-existent or a no-op#5508
Conversation
|
Still needs the unit tests (to be adjusted) for all the options involved. Update: And a ticket... |
8355d27 to
8ccb269
Compare
| " Unknown type sizes\n" | ||
| " --plist-output=<path>\n" | ||
| " Generate Clang-plist output files in folder.\n"; | ||
| " -l <load> Specifies that no new threads should be started if\n" |
There was a problem hiding this comment.
hmm.. somehow it seems not ideal to display this option in the help output when it's not available at all. if we include it in the help output I suggest that we indicate that it is not available.
There was a problem hiding this comment.
It is included in the manpage and the manual which are both static files.
The command-line should be treated like any API which is a fixed interface which will provide an error when something is not working/available.
Also some of this might be based on on checks in config.h which are based on the underlying system/compiler and might not even be controllable by the user which builds the binary (like not having process support on Windows).
We might be able to improve the documentation a bit but that should not be in the --help output which is just an overview and not an in-depth documentation. That's what the manpage is for.
There was a problem hiding this comment.
Yes the manual is static as you say. But in this case we can be dynamic. How about writing a "NOT AVAILABLE" at least?
There was a problem hiding this comment.
That would be quite subtle and re-introduce the usage of the preprocessor checks in the help which I also wanted to get rid of.
I guess we should use a struct to store information on each option and generate the help from that. That could also help with generating the manpage output so the information not duplicated. We could also add a note to the static documentation that the availability of that option depends on the platform or build options.
There was a problem hiding this comment.
We could also add a note to the static documentation that the availability of that option depends on the platform or build options.
👍
…ead of treating it as non-existent or a no-op
|
I guess we can tweak it further in future PRs.. |
Also disabled more internal code around those options and did some cleanups.