The gcc (or g++) compiler has a -std option to specify the language standard to use for compiling C or C++. At the top level one can see that this option exists.
gcc --help
-std=<standard> Assume that the input sources are for <standard>
However, different versions of the gcc compilers will have a different set of supported standards.
Is there a simple and direct way to ask for detailed help on just that option so that one gets the details about accepted standards, etc. for just that option?
I have done kludges in the past where I dumped exhaustive help about all manner of options and then tried to filter out just the lines I wanted by piping it through grep (see footnote). I'm not asking for that. I'm asking for a way to get the details for just the option one wants (such as -std) directly without any such ugly kludge. (Besides being awkward, the ugly kludges become problematic regarding getting all the relevant detail lines, including those lines concerning the option that don't happen to include whatever search term one is using to filter without knowing the extent of surrounding help text.)
It's hard to believe there is no direct way to do this. Surely other people must want to be able to get detailed information about some option without getting mounds of unrelated other stuff besides. I'm hoping someone can tell me the simple method I'm missing. It's not this...
gcc --help=std
cc1: warning: unrecognized argument to --help= option: ‘std’
*Sedenion was kind enough to provide the following example of the grep approach, which some readers of this question may find helpful.
gcc -Q --help=c++ | grep "\-std="
If someone only wants lines containing a known string, something like this could serve, if one remembers all the arguments and syntax details. If one wants other lines in the same entry for some gcc option, that becomes trickier since one doesn't necessarily know in advance what lines to capture. (Remember that -std is the example of the more general need for a better help option.)