Skip to content

Commit ca5e974

Browse files
committed
Fix danmar#3578 (--std help text in cli is confusing)
http://sourceforge.net/apps/trac/cppcheck/ticket/3578
1 parent bbb707c commit ca5e974

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

cli/cmdlineparser.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ void CmdLineParser::PrintHelp() const
727727
" Warn if there are missing includes. For\n"
728728
" detailed information, use '--check-config'.\n"
729729
" Several ids can be given if you separate them with\n"
730-
" commas.\n"
730+
" commas. See also --std\n"
731731
" --error-exitcode=<n> If errors are found, integer [n] is returned instead of\n"
732732
" the default '0'. '" << EXIT_FAILURE << "' is returned\n"
733733
" if arguments are not valid or if no input files are\n"
@@ -787,14 +787,16 @@ void CmdLineParser::PrintHelp() const
787787
" https://sourceforge.net/projects/cppcheck/files/Articles/\n"
788788
#endif
789789
" -s, --style Deprecated, please use '--enable=style' instead\n"
790-
" --std=<id> Environment. The available options are:\n"
790+
" --std=<id> Enable some standard related checks.\n"
791+
" The available options are:\n"
791792
" * posix\n"
792-
" Use this if a posix environment is available\n"
793+
" Checks related to POSIX-specific functionality\n"
793794
" * c99\n"
794-
" Use this if the compiler is C99 compatible\n"
795+
" C99 standard related checks\n"
795796
" * c++11\n"
796-
" Use this if the compiler is C++11 compatible.\n"
797-
" note: you probably want to also use 'c99'.\n"
797+
" C++11 standard related checks\n"
798+
" Example to enable more than one checks:\n"
799+
" 'cppcheck --std=c99 --std=posix file.cpp'\n"
798800
" --suppress=<spec> Suppress warnings that match <spec>. The format of\n"
799801
" <spec> is:\n"
800802
" [error id]:[filename]:[line]\n"

man/cppcheck.1.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ Example: '-UDEBUG'</para>
228228
</glossdef>
229229
</glossentry>
230230
</glosslist>
231-
By default none of the additional checks are enabled. Several ids can be given if you separate them with commas, e.g. --enable=style,unusedFunction.
231+
By default none of the additional checks are enabled. Several ids can be given if you separate them with commas, e.g. --enable=style,unusedFunction. See also --std
232232
</para>
233233
</listitem>
234234
</varlistentry>
@@ -392,28 +392,28 @@ Directory name is matched to all parts of the path.</para>
392392
<varlistentry>
393393
<term><option>--std=&lt;id&gt;</option></term>
394394
<listitem>
395-
<para>Enable some environment related checks. The available options are:
395+
<para>Enable some standard related checks. The available options are:
396396
<glosslist>
397397
<glossentry>
398398
<glossterm>posix</glossterm>
399399
<glossdef>
400-
<para>Use this if you want to see posix related errors</para>
400+
<para>Checks related to POSIX-specific functionality</para>
401401
</glossdef>
402402
</glossentry>
403403
<glossentry>
404404
<glossterm>c99</glossterm>
405405
<glossdef>
406-
<para>Use this if the compiler is C99 compatible</para>
406+
<para>C99 standard related checks</para>
407407
</glossdef>
408408
</glossentry>
409409
<glossentry>
410410
<glossterm>c++11</glossterm>
411411
<glossdef>
412-
<para>Use this if the compiler is C++11 compatible. Note: you probably want to also use 'c99'.</para>
412+
<para>C++11 standard related checks</para>
413413
</glossdef>
414414
</glossentry>
415415
</glosslist>
416-
By default all are disabled. To enable more than one, just use --std more than once: 'cppcheck --std=c99 --std=c++11 file.cpp'
416+
Example to enable more than one checks: 'cppcheck --std=c99 --std=posix file.cpp'
417417
</para>
418418
</listitem>
419419
</varlistentry>

0 commit comments

Comments
 (0)