Thrift compiler to tokenize args by " " so you can use script files

Summary: if you do #!/usr/local/bin/thrift --php --cpp it shows up as one arg: "--php --cpp" so you need to tokenize that


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664805 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/main.cc b/compiler/cpp/src/main.cc
index f75bd53..5cbf53e 100644
--- a/compiler/cpp/src/main.cc
+++ b/compiler/cpp/src/main.cc
@@ -126,23 +126,30 @@
   }
 
   for (i = 1; i < argc-1; i++) {
-    if (strcmp(argv[i], "--debug") == 0) {
-      g_debug = 1;
-    } else if (strcmp(argv[i], "--cpp") == 0) {
-      gen_cpp = true;
-    } else if (strcmp(argv[i], "--java") == 0) {
-      gen_java = true;
-    } else if (strcmp(argv[i], "--php") == 0) {
-      gen_php = true;
-      php_inline = false;
-    } else if (strcmp(argv[i], "--phpi") == 0) {
-      gen_php = true;
-      php_inline = true;
-    } else if (strcmp(argv[i], "--py") == 0) {
-      gen_py = true;
-    } else {
-      fprintf(stderr, "!!! Unrecognized option: %s\n", argv[i]);
-      usage();
+    char* arg;
+    arg = strtok(argv[i], " ");
+    while (arg != NULL) {
+      if (strcmp(arg, "--debug") == 0) {
+        g_debug = 1;
+      } else if (strcmp(arg, "--cpp") == 0) {
+        gen_cpp = true;
+      } else if (strcmp(arg, "--java") == 0) {
+        gen_java = true;
+      } else if (strcmp(arg, "--php") == 0) {
+        gen_php = true;
+        php_inline = false;
+      } else if (strcmp(arg, "--phpi") == 0) {
+        gen_php = true;
+        php_inline = true;
+      } else if (strcmp(arg, "--py") == 0) {
+        gen_py = true;
+      } else {
+        fprintf(stderr, "!!! Unrecognized option: %s\n", arg);
+        usage();
+      }
+
+      // Tokenize more
+      arg = strtok(NULL, " ");
     }
   }