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