Merge pull request #995 from dart-lang/return_exit_code

Return exitCode from FormatCommand.run()
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fcc6c1d..6e44179 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,8 @@
 # 1.3.14
 
 * Add support for generic annotations.
+* `FormatCommand.run()` now returns the value set in `exitCode` during
+  formatting.
 
 # 1.3.13
 
diff --git a/lib/src/cli/format_command.dart b/lib/src/cli/format_command.dart
index 4432f7b..5b14a7e 100644
--- a/lib/src/cli/format_command.dart
+++ b/lib/src/cli/format_command.dart
@@ -156,6 +156,8 @@
       options.summary.show();
     }
 
-    return 0;
+    // Return the exitCode explicitly for tools which embed dart_style
+    // and set their own exitCode.
+    return exitCode;
   }
 }