summaryrefslogtreecommitdiffstats
path: root/updater/update_simulator_main.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2019-07-31 01:48:52 +0200
committerTianjie Xu <xunchang@google.com>2019-07-31 02:11:35 +0200
commit60b242cfd58a234727f5d339e2f6fa4e91ffe1fa (patch)
tree2c3f3befcf97039b2670395d18a2f953bc1c70c4 /updater/update_simulator_main.cpp
parentMerge "Create a new function to return the help message for menu" (diff)
downloadandroid_bootable_recovery-60b242cfd58a234727f5d339e2f6fa4e91ffe1fa.tar
android_bootable_recovery-60b242cfd58a234727f5d339e2f6fa4e91ffe1fa.tar.gz
android_bootable_recovery-60b242cfd58a234727f5d339e2f6fa4e91ffe1fa.tar.bz2
android_bootable_recovery-60b242cfd58a234727f5d339e2f6fa4e91ffe1fa.tar.lz
android_bootable_recovery-60b242cfd58a234727f5d339e2f6fa4e91ffe1fa.tar.xz
android_bootable_recovery-60b242cfd58a234727f5d339e2f6fa4e91ffe1fa.tar.zst
android_bootable_recovery-60b242cfd58a234727f5d339e2f6fa4e91ffe1fa.zip
Diffstat (limited to 'updater/update_simulator_main.cpp')
-rw-r--r--updater/update_simulator_main.cpp13
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;