From 2f77417cce18a4e9247b1ad96682131974a32863 Mon Sep 17 00:00:00 2001 From: Christopher Wiley Date: Sun, 30 Aug 2015 10:57:07 -0700 Subject: aidl: Pull main() into dedicated file This separates the main() entry point from the functionality we're hoping to test. While here, redo the header guards to be consistent accross the codebae. Bug: 23516947 Change-Id: I61666126bdba0941f14bd0f031caaa30367b864a Test: Compiles --- tools/aidl/main.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tools/aidl/main.cpp (limited to 'tools/aidl/main.cpp') 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 + +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; +} -- cgit v1.2.3-59-g8ed1b