summaryrefslogtreecommitdiff
path: root/tools/aapt2/Flags.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt2/Flags.cpp')
-rw-r--r--tools/aapt2/Flags.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/aapt2/Flags.cpp b/tools/aapt2/Flags.cpp
index 666e8a8efff1..3731ac74f4ed 100644
--- a/tools/aapt2/Flags.cpp
+++ b/tools/aapt2/Flags.cpp
@@ -69,6 +69,17 @@ Flags& Flags::optionalFlagList(const StringPiece& name, const StringPiece& descr
return *this;
}
+Flags& Flags::optionalFlagList(const StringPiece& name, const StringPiece& description,
+ std::unordered_set<std::string>* value) {
+ auto func = [value](const StringPiece& arg) -> bool {
+ value->insert(arg.toString());
+ return true;
+ };
+
+ mFlags.push_back(Flag{ name.toString(), description.toString(), func, false, 1, false });
+ return *this;
+}
+
Flags& Flags::optionalSwitch(const StringPiece& name, const StringPiece& description,
bool* value) {
auto func = [value](const StringPiece& arg) -> bool {
@@ -101,7 +112,7 @@ void Flags::usage(const StringPiece& command, std::ostream* out) {
// Split the description by newlines and write out the argument (which is empty after
// the first line) followed by the description line. This will make sure that multiline
// descriptions are still right justified and aligned.
- for (StringPiece line : util::tokenize<char>(flag.description, '\n')) {
+ for (StringPiece line : util::tokenize(flag.description, '\n')) {
*out << " " << std::setw(kWidth) << std::left << argLine << line << "\n";
argLine = " ";
}