Selaa lähdekoodia

Whitespace changes in help messages + updated help output in .rst file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189762 91177308-0d34-0410-b5e6-96231b3b80d8
Alexander Kornienko 12 vuotta sitten
vanhempi
commit
7de13bb716
2 muutettua tiedostoa jossa 15 lisäystä ja 7 poistoa
  1. 11 3
      docs/ClangFormat.rst
  2. 4 4
      tools/clang-format/ClangFormat.cpp

+ 11 - 3
docs/ClangFormat.rst

@@ -15,13 +15,13 @@ to format C/C++/Obj-C code.
 
 
 .. code-block:: console
 .. code-block:: console
 
 
-  $ clang-format --help
+  $ clang-format -help
   OVERVIEW: A tool to format C/C++/Obj-C code.
   OVERVIEW: A tool to format C/C++/Obj-C code.
 
 
   If no arguments are specified, it formats the code from standard input
   If no arguments are specified, it formats the code from standard input
   and writes the result to the standard output.
   and writes the result to the standard output.
-  If <file>s are given, it reformats the files. If -i is specified 
-  together with <file>s, the files are edited in-place. Otherwise, the 
+  If <file>s are given, it reformats the files. If -i is specified
+  together with <file>s, the files are edited in-place. Otherwise, the
   result is written to the standard output.
   result is written to the standard output.
 
 
   USAGE: clang-format [options] [<file> ...]
   USAGE: clang-format [options] [<file> ...]
@@ -30,6 +30,8 @@ to format C/C++/Obj-C code.
 
 
   Clang-format options:
   Clang-format options:
 
 
+    -cursor=<uint>           - The position of the cursor when invoking
+                               clang-format from an editor integration
     -dump-config             - Dump configuration options to stdout and exit.
     -dump-config             - Dump configuration options to stdout and exit.
                                Can be used with -style option.
                                Can be used with -style option.
     -i                       - Inplace edit <file>s, if specified.
     -i                       - Inplace edit <file>s, if specified.
@@ -40,6 +42,12 @@ to format C/C++/Obj-C code.
                                -length, clang-format will format up to the end
                                -length, clang-format will format up to the end
                                of the file.
                                of the file.
                                Can only be used with one input file.
                                Can only be used with one input file.
+    -lines=<string>          - <start line>:<end line> - format a range of
+                               lines (both 1-based).
+                               Multiple ranges can be formatted by specifying
+                               several -lines arguments.
+                               Can't be used with -offset and -length.
+                               Can only be used with one input file.
     -offset=<uint>           - Format a range starting at this byte offset.
     -offset=<uint>           - Format a range starting at this byte offset.
                                Multiple ranges can be formatted by specifying
                                Multiple ranges can be formatted by specifying
                                several -offset and -length pairs.
                                several -offset and -length pairs.

+ 4 - 4
tools/clang-format/ClangFormat.cpp

@@ -87,8 +87,8 @@ static cl::opt<bool>
                cl::cat(ClangFormatCategory));
                cl::cat(ClangFormatCategory));
 static cl::opt<unsigned>
 static cl::opt<unsigned>
     Cursor("cursor",
     Cursor("cursor",
-           cl::desc("The position of the cursor when invoking clang-format from"
-                    " an editor integration"),
+           cl::desc("The position of the cursor when invoking\n"
+                    "clang-format from an editor integration"),
            cl::init(0), cl::cat(ClangFormatCategory));
            cl::init(0), cl::cat(ClangFormatCategory));
 
 
 static cl::list<std::string> FileNames(cl::Positional, cl::desc("[<file> ...]"),
 static cl::list<std::string> FileNames(cl::Positional, cl::desc("[<file> ...]"),
@@ -310,8 +310,8 @@ int main(int argc, const char **argv) {
       "A tool to format C/C++/Obj-C code.\n\n"
       "A tool to format C/C++/Obj-C code.\n\n"
       "If no arguments are specified, it formats the code from standard input\n"
       "If no arguments are specified, it formats the code from standard input\n"
       "and writes the result to the standard output.\n"
       "and writes the result to the standard output.\n"
-      "If <file>s are given, it reformats the files. If -i is specified \n"
-      "together with <file>s, the files are edited in-place. Otherwise, the \n"
+      "If <file>s are given, it reformats the files. If -i is specified\n"
+      "together with <file>s, the files are edited in-place. Otherwise, the\n"
       "result is written to the standard output.\n");
       "result is written to the standard output.\n");
 
 
   if (Help)
   if (Help)