[util] Add --batch to hb-view / hb-ot-shape-closure
diff --git a/util/batch.hh b/util/batch.hh
index 2cbb120..9543a05 100644
--- a/util/batch.hh
+++ b/util/batch.hh
@@ -25,6 +25,8 @@
 #ifndef BATCH_HH
 #define BATCH_HH
 
+#include "options.hh"
+
 typedef int (*main_func_t) (int argc, char **argv);
 
 template <typename main_t, bool report_status=false>
diff --git a/util/hb-ot-shape-closure.cc b/util/hb-ot-shape-closure.cc
index 776e670..a77fc82 100644
--- a/util/hb-ot-shape-closure.cc
+++ b/util/hb-ot-shape-closure.cc
@@ -24,10 +24,11 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "shape-options.hh"
+#include "batch.hh"
 #include "font-options.hh"
-#include "text-options.hh"
 #include "main-font-text.hh"
+#include "shape-options.hh"
+#include "text-options.hh"
 
 const unsigned DEFAULT_FONT_SIZE = FONT_SIZE_NONE;
 const unsigned SUBPIXEL_BITS = 0;
@@ -115,5 +116,6 @@
 int
 main (int argc, char **argv)
 {
-  return main_font_text_t<shape_closure_consumer_t, font_options_t, text_options_t> () (argc, argv);
+  using main_t = main_font_text_t<shape_closure_consumer_t, font_options_t, text_options_t>;
+  return batch_main<main_t> (argc, argv);
 }
diff --git a/util/hb-shape.cc b/util/hb-shape.cc
index 0e8263b..d8922dc 100644
--- a/util/hb-shape.cc
+++ b/util/hb-shape.cc
@@ -25,13 +25,13 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "output-options.hh"
+#include "batch.hh"
 #include "font-options.hh"
-#include "text-options.hh"
+#include "main-font-text.hh"
+#include "output-options.hh"
 #include "shape-consumer.hh"
 #include "shape-format.hh"
-#include "batch.hh"
-#include "main-font-text.hh"
+#include "text-options.hh"
 
 const unsigned DEFAULT_FONT_SIZE = FONT_SIZE_UPEM;
 const unsigned SUBPIXEL_BITS = 0;
diff --git a/util/hb-subset.cc b/util/hb-subset.cc
index d65ee82..9d8d0c2 100644
--- a/util/hb-subset.cc
+++ b/util/hb-subset.cc
@@ -25,12 +25,10 @@
  * Google Author(s): Garret Rieger, Rod Sheeter
  */
 
-#include <stdio.h>
-
-#include "output-options.hh"
-#include "face-options.hh"
 #include "batch.hh"
+#include "face-options.hh"
 #include "main-font-text.hh"
+#include "output-options.hh"
 
 #include <hb-subset.h>
 
diff --git a/util/hb-view.cc b/util/hb-view.cc
index 2664c7c..82761fb 100644
--- a/util/hb-view.cc
+++ b/util/hb-view.cc
@@ -25,11 +25,12 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "shape-consumer.hh"
-#include "view-cairo.hh"
+#include "batch.hh"
 #include "font-options.hh"
-#include "text-options.hh"
 #include "main-font-text.hh"
+#include "shape-consumer.hh"
+#include "text-options.hh"
+#include "view-cairo.hh"
 
 const unsigned DEFAULT_FONT_SIZE = 256;
 const unsigned SUBPIXEL_BITS = 6;
@@ -37,5 +38,6 @@
 int
 main (int argc, char **argv)
 {
-  return main_font_text_t<shape_consumer_t<view_cairo_t>, font_options_t, shape_text_options_t> () (argc, argv);
+  using main_t = main_font_text_t<shape_consumer_t<view_cairo_t>, font_options_t, shape_text_options_t>;
+  return batch_main<main_t> (argc, argv);
 }