]> granicus.if.org Git - llvm/commitdiff
[docs] Fix a missing code-block in the new Error docs.
authorLang Hames <lhames@gmail.com>
Tue, 25 Oct 2016 22:25:07 +0000 (22:25 +0000)
committerLang Hames <lhames@gmail.com>
Tue, 25 Oct 2016 22:25:07 +0000 (22:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285134 91177308-0d34-0410-b5e6-96231b3b80d8

docs/ProgrammersManual.rst

index d970f1af04e1e3bb8cb7025e532b577b946dd439..2f2281c6fcc80b9543b9e0934531d5866787bdec 100644 (file)
@@ -614,14 +614,16 @@ preceded by a string “banner” that can be set by calling the setBanner metho
 mapping can also be supplied from ``Error`` values to exit codes using the
 ``setExitCodeMapper`` method:
 
-int main(int argc, char *argv[]) {
-  ExitOnErr.setBanner(std::string(argv[0]) + “ error:”);
-  ExitOnErr.setExitCodeMapper(
-    [](const Error &Err) {
-      if (Err.isA<BadFileFormat>())
-        return 2;
-      return 1;
-    });
+.. code-block:: c++
+
+  int main(int argc, char *argv[]) {
+    ExitOnErr.setBanner(std::string(argv[0]) + “ error:”);
+    ExitOnErr.setExitCodeMapper(
+      [](const Error &Err) {
+        if (Err.isA<BadFileFormat>())
+          return 2;
+        return 1;
+      });
 
 Use ``ExitOnError`` in your tool code where possible as it can greatly improve
 readability.