summaryrefslogtreecommitdiff
path: root/tools/aidl/main.cpp
diff options
context:
space:
mode:
author Christopher Wiley <wiley@google.com> 2015-08-31 19:03:44 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-08-31 19:03:44 +0000
commit1643e97b330d6c0f47e8643e52b12c6887a89f81 (patch)
treee5ce2ea7884d84305207da1af3fcfc400e5deadc /tools/aidl/main.cpp
parent2b83384f44ffa30d1d3d61ded9ac4f83a275b77d (diff)
parent2f77417cce18a4e9247b1ad96682131974a32863 (diff)
Merge "aidl: Pull main() into dedicated file"
Diffstat (limited to 'tools/aidl/main.cpp')
-rw-r--r--tools/aidl/main.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/aidl/main.cpp b/tools/aidl/main.cpp
new file mode 100644
index 000000000000..7cc2198bb5df
--- /dev/null
+++ b/tools/aidl/main.cpp
@@ -0,0 +1,23 @@
+#include "aidl.h"
+#include "options.h"
+
+#include <stdio.h>
+
+int
+main(int argc, const char **argv)
+{
+ Options options;
+ int result = parse_options(argc, argv, &options);
+ if (result) {
+ return result;
+ }
+
+ switch (options.task) {
+ case COMPILE_AIDL:
+ return compile_aidl(options);
+ case PREPROCESS_AIDL:
+ return preprocess_aidl(options);
+ }
+ fprintf(stderr, "aidl: internal error\n");
+ return 1;
+}