[C++] Fix -c flag and add -i flag
diff --git a/exec.cc b/exec.cc
index bc4497f..9e6b1ab 100644
--- a/exec.cc
+++ b/exec.cc
@@ -161,7 +161,7 @@
         printf("%s\n", runner->cmd->c_str());
         fflush(stdout);
       }
-      if (!g_is_syntax_check_only) {
+      if (!g_is_dry_run) {
         int result = system(runner->cmd->c_str());
         if (result != 0) {
           if (runner->ignore_error) {
diff --git a/flags.cc b/flags.cc
index 0c611df..de95408 100644
--- a/flags.cc
+++ b/flags.cc
@@ -16,4 +16,4 @@
 
 #include "flags.h"
 
-bool g_is_syntax_check_only;
+bool g_is_dry_run;
diff --git a/flags.h b/flags.h
index 570d6b1..a2e806a 100644
--- a/flags.h
+++ b/flags.h
@@ -15,6 +15,6 @@
 #ifndef FLAGS_H_
 #define FLAGS_H_
 
-extern bool g_is_syntax_check_only;
+extern bool g_is_dry_run;
 
 #endif  // FLAGS_H_
diff --git a/main.cc b/main.cc
index 3bb9fe6..3b503fa 100644
--- a/main.cc
+++ b/main.cc
@@ -36,6 +36,7 @@
 #include "var.h"
 
 static const char* g_makefile;
+static bool g_is_syntax_check_only;
 
 static void ParseCommandLine(int argc, char* argv[],
                              vector<StringPiece>* targets,
@@ -46,6 +47,8 @@
       g_makefile = argv[++i];
     } else if (!strcmp(arg, "-c")) {
       g_is_syntax_check_only = true;
+    } else if (!strcmp(arg, "-i")) {
+      g_is_dry_run = true;
     } else if (arg[0] == '-') {
       ERROR("Unknown flag: %s", arg);
     } else {
@@ -179,6 +182,9 @@
     }
   }
 
+  if (g_is_syntax_check_only)
+    return 0;
+
   Exec(nodes, ev);
 
   for (AST* ast : bootstrap_asts)
@@ -187,7 +193,7 @@
   delete vars;
   delete cache_mgr;
 
-  return mk == 0;
+  return 0;
 }
 
 int main(int argc, char* argv[]) {