Improve --help listing by removing duplicate options list and using lt and gt characters for option arguments.

This commit is contained in:
Reijo Tomperi 2011-02-05 22:59:26 +02:00
parent bc5abd063f
commit 2bded1091b
1 changed files with 23 additions and 27 deletions

View File

@ -607,71 +607,67 @@ void CmdLineParser::PrintHelp()
std::cout << "Cppcheck - A tool for static C/C++ code analysis\n" std::cout << "Cppcheck - A tool for static C/C++ code analysis\n"
"\n" "\n"
"Syntax:\n" "Syntax:\n"
" cppcheck [--append=file] [-D<ID>] [--enable=<id>] [--error-exitcode=[n]]\n" " cppcheck [OPTIONS] [files or paths]\n"
" [--exitcode-suppressions file] [--file-list=file.txt] [--force]\n"
" [--help] [-Idir] [--inline-suppr] [-j [jobs]] [--quiet]\n"
" [--report-progress] [--rule=<rule>] [--rule-file=<file>]\n"
" [--style] [--suppressions-list=file.txt] [--verbose]\n"
" [--version] [--xml] [file or path1] [file or path]\n"
"\n" "\n"
"If path is given instead of filename, *.cpp, *.cxx, *.cc, *.c++ and *.c files\n" "If path is given instead of filename, *.cpp, *.cxx, *.cc, *.c++ and *.c files\n"
"are checked recursively from given directory.\n\n" "are checked recursively from given directory.\n\n"
"Options:\n" "Options:\n"
" --append=file This allows you to provide information about\n" " --append=<file> This allows you to provide information about\n"
" functions by providing an implementation for these.\n" " functions by providing an implementation for these.\n"
" -D<ID> By default Cppcheck checks all configurations.\n" " -D<ID> By default Cppcheck checks all configurations.\n"
" Use -D to limit the checking. When -D is used the\n" " Use -D to limit the checking. When -D is used the\n"
" checking is limited to the given configuration.\n" " checking is limited to the given configuration.\n"
" Example: -DDEBUG=1 -D__cplusplus\n" " Example: -DDEBUG=1 -D__cplusplus\n"
" --enable=id Enable additional checks. The available ids are:\n" " --enable=<id> Enable additional checks. The available ids are:\n"
" * all - enable all checks\n" " * all - enable all checks\n"
" * style - Check coding style\n" " * style - Check coding style\n"
" * information - Enable information messages\n" " * information - Enable information messages\n"
" * unusedFunction - check for unused functions\n" " * unusedFunction - check for unused functions\n"
" * missingInclude - check for missing includes\n" " * missingInclude - check for missing includes\n"
" Several ids can be given if you separate them with commas\n" " Several ids can be given if you separate them with commas.\n"
" --error-exitcode=[n] If errors are found, integer [n] is returned instead\n" " --error-exitcode=<n> If errors are found, integer [n] is returned instead\n"
" of default 0. EXIT_FAILURE is returned\n" " of default 0. EXIT_FAILURE is returned\n"
" if arguments are not valid or if no input files are\n" " if arguments are not valid or if no input files are\n"
" provided. Note that your operating system can\n" " provided. Note that your operating system can\n"
" modify this value, e.g. 256 can become 0.\n" " modify this value, e.g. 256 can become 0.\n"
" --errorlist Print a list of all error messages in XML format.\n" " --errorlist Print a list of all error messages in XML format.\n"
" --exitcode-suppressions=file\n" " --exitcode-suppressions=<file>\n"
" Used when certain messages should be displayed but\n" " Used when certain messages should be displayed but\n"
" should not cause a non-zero exitcode.\n" " should not cause a non-zero exitcode.\n"
" --file-list=file Specify the files to check in a text file. One Filename per line.\n" " --file-list=<file> Specify the files to check in a text file. One Filename per line.\n"
" -f, --force Force checking on files that have \"too many\"\n" " -f, --force Force checking on files that have \"too many\"\n"
" configurations\n" " configurations.\n"
" -h, --help Print this help\n" " -h, --help Print this help.\n"
" -I [dir] Give include path. Give several -I parameters to give\n" " -I <dir> Give include path. Give several -I parameters to give\n"
" several paths. First given path is checked first. If\n" " several paths. First given path is checked first. If\n"
" paths are relative to source files, this is not needed\n" " paths are relative to source files, this is not needed.\n"
" -i [dir] Give path to ignore. Give several -i parameters to ignore\n" " -i <dir> Give path to ignore. Give several -i parameters to ignore\n"
" several paths. Give directory name or filename with path\n" " several paths. Give directory name or filename with path\n"
" as parameter. Directory name is matched to all parts of the\n" " as parameter. Directory name is matched to all parts of the\n"
" path.\n" " path.\n"
" --inline-suppr Enable inline suppressions. Use them by placing one or\n" " --inline-suppr Enable inline suppressions. Use them by placing one or\n"
" more comments, like: // cppcheck-suppress warningId\n" " more comments, like: // cppcheck-suppress warningId\n"
" on the lines before the warning to suppress.\n" " on the lines before the warning to suppress.\n"
" -j [jobs] Start [jobs] threads to do the checking simultaneously.\n" " -j <jobs> Start [jobs] threads to do the checking simultaneously.\n"
" -q, --quiet Only print error messages\n" " -q, --quiet Only print error messages.\n"
" --report-progress Report progress messages while checking a file.\n" " --report-progress Report progress messages while checking a file.\n"
" --rule=<rule> match regular expression\n" " --rule=<rule> Match regular expression.\n"
" --rule-file=<file> use given rule file\n" " --rule-file=<file> Use given rule file. For more information, see: \n"
" -s, --style deprecated, use --enable=style\n" " https://sourceforge.net/projects/cppcheck/files/Articles/\n"
" --suppressions-list=file\n" " -s, --style Deprecated, use --enable=style\n"
" --suppressions-list=<file>\n"
" Suppress warnings listed in the file. Filename and line\n" " Suppress warnings listed in the file. Filename and line\n"
" are optional in the suppression file. The format of the\n" " are optional in the suppression file. The format of the\n"
" single line in the suppression file is:\n" " single line in the suppression file is:\n"
" [error id]:[filename]:[line]\n" " [error id]:[filename]:[line]\n"
" --template '[text]' Format the error messages. E.g.\n" " --template '<text>' Format the error messages. E.g.\n"
" '{file}:{line},{severity},{id},{message}' or\n" " '{file}:{line},{severity},{id},{message}' or\n"
" '{file}({line}):({severity}) {message}'\n" " '{file}({line}):({severity}) {message}'\n"
" Pre-defined templates: gcc, vs\n" " Pre-defined templates: gcc, vs\n"
" -v, --verbose More detailed error reports\n" " -v, --verbose More detailed error reports.\n"
" --version Print out version number\n" " --version Print out version number.\n"
" --xml Write results in xml to error stream.\n" " --xml Write results in xml to error stream.\n"
" --xml-version=[version]\n" " --xml-version=<version>\n"
" Select the XML file version. Currently versions 1 and 2\n" " Select the XML file version. Currently versions 1 and 2\n"
" are available. The default version is 1." " are available. The default version is 1."
"\n" "\n"