diff options
| author | Victor Hsieh <victorhsieh@google.com> | 2021-10-01 16:33:17 -0700 |
|---|---|---|
| committer | Victor Hsieh <victorhsieh@google.com> | 2021-10-06 08:39:15 -0700 |
| commit | 86d87ad5891abd60b16b2b3388b394566ffa4b62 (patch) | |
| tree | 186d6b943f45c2fabf55bd2045d972ae6b8c5200 /derive_classpath/main.cpp | |
| parent | 7089c615eeaf7bf138d20e00ade61248a94bf743 (diff) | |
| download | platform_packages_modules_SdkExtensions-86d87ad5891abd60b16b2b3388b394566ffa4b62.tar.gz platform_packages_modules_SdkExtensions-86d87ad5891abd60b16b2b3388b394566ffa4b62.tar.bz2 platform_packages_modules_SdkExtensions-86d87ad5891abd60b16b2b3388b394566ffa4b62.zip | |
Refactor various options into a struct
There should be no functional change.
Bug: 198212494
Test: atest DeriveClasspathTest
Test: device still boot
Change-Id: Ic17052de30f71a0243d0f7280212b654729950ea
Diffstat (limited to 'derive_classpath/main.cpp')
| -rw-r--r-- | derive_classpath/main.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/derive_classpath/main.cpp b/derive_classpath/main.cpp index b896eb9..d589680 100644 --- a/derive_classpath/main.cpp +++ b/derive_classpath/main.cpp @@ -15,22 +15,27 @@ */ #include <android-base/logging.h> +#include <android-base/strings.h> #include <cstdlib> #include <string_view> #include "derive_classpath.h" int main(int argc, char** argv) { - std::string_view output_location; + // Default args + android::derive_classpath::Args args = { + .output_path = android::derive_classpath::kGeneratedClasspathExportsFilepath, + .glob_pattern_prefix = "", + }; if (argc == 1) { - output_location = android::derive_classpath::kGeneratedClasspathExportsFilepath; + args.output_path = android::derive_classpath::kGeneratedClasspathExportsFilepath; } else if (argc == 2) { - output_location = argv[1]; + args.output_path = argv[1]; } else { LOG(ERROR) << "too many arguments " << argc; return EXIT_FAILURE; } - if (!android::derive_classpath::GenerateClasspathExports(output_location)) { + if (!android::derive_classpath::GenerateClasspathExports(args)) { return EXIT_FAILURE; } return EXIT_SUCCESS; |
