diff options
author | Tianjie Xu <xunchang@google.com> | 2019-08-01 00:34:34 +0200 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-08-01 00:34:34 +0200 |
commit | c34e4e7fb58d335ed985e561752e300168b1db4c (patch) | |
tree | 2c3f3befcf97039b2670395d18a2f953bc1c70c4 /updater/update_simulator_main.cpp | |
parent | Merge "Create a new function to return the help message for menu" (diff) | |
parent | Simulator: add the argument to keep the updated images (diff) | |
download | android_bootable_recovery-c34e4e7fb58d335ed985e561752e300168b1db4c.tar android_bootable_recovery-c34e4e7fb58d335ed985e561752e300168b1db4c.tar.gz android_bootable_recovery-c34e4e7fb58d335ed985e561752e300168b1db4c.tar.bz2 android_bootable_recovery-c34e4e7fb58d335ed985e561752e300168b1db4c.tar.lz android_bootable_recovery-c34e4e7fb58d335ed985e561752e300168b1db4c.tar.xz android_bootable_recovery-c34e4e7fb58d335ed985e561752e300168b1db4c.tar.zst android_bootable_recovery-c34e4e7fb58d335ed985e561752e300168b1db4c.zip |
Diffstat (limited to 'updater/update_simulator_main.cpp')
-rw-r--r-- | updater/update_simulator_main.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/updater/update_simulator_main.cpp b/updater/update_simulator_main.cpp index 278a44057..6c6989bac 100644 --- a/updater/update_simulator_main.cpp +++ b/updater/update_simulator_main.cpp @@ -58,12 +58,16 @@ int main(int argc, char** argv) { std::string skip_function_file; std::string source_target_file; std::string package_name; + std::string work_dir; + bool keep_images = false; constexpr struct option OPTIONS[] = { + { "keep_images", no_argument, nullptr, 0 }, { "oem_settings", required_argument, nullptr, 0 }, { "ota_package", required_argument, nullptr, 0 }, { "skip_functions", required_argument, nullptr, 0 }, { "source", required_argument, nullptr, 0 }, + { "work_dir", required_argument, nullptr, 0 }, { nullptr, 0, nullptr, 0 }, }; @@ -86,6 +90,10 @@ int main(int argc, char** argv) { source_target_file = optarg; } else if (option_name == "ota_package"s) { package_name = optarg; + } else if (option_name == "keep_images"s) { + keep_images = true; + } else if (option_name == "work_dir"s) { + work_dir = optarg; } else { Usage(argv[0]); return EXIT_FAILURE; @@ -129,8 +137,11 @@ int main(int argc, char** argv) { TemporaryFile cmd_pipe; TemporaryDir source_temp_dir; + if (work_dir.empty()) { + work_dir = source_temp_dir.path; + } - BuildInfo source_build_info(source_temp_dir.path); + BuildInfo source_build_info(work_dir, keep_images); if (!source_build_info.ParseTargetFile(source_target_file, false)) { LOG(ERROR) << "Failed to parse the target file " << source_target_file; return EXIT_FAILURE; |