summaryrefslogtreecommitdiff
path: root/tools/aapt2/Flags.cpp
diff options
context:
space:
mode:
author Adam Lesinski <adamlesinski@google.com> 2015-11-02 16:10:55 -0800
committer Adam Lesinski <adamlesinski@google.com> 2015-11-02 16:56:34 -0800
commit2ae4a877d1623f851040ce69239552c873f1abf0 (patch)
treeb13fd89771d05c8f5471218695c9eff5ab287b23 /tools/aapt2/Flags.cpp
parent3b4cd94034ff3e5567a2ba6da35d640ff61db4b9 (diff)
AAPT2: Add Manifest fixing/validation
Change-Id: I7f6d8b74d1c590adc356b4da55cb6cb777cdf1da
Diffstat (limited to 'tools/aapt2/Flags.cpp')
-rw-r--r--tools/aapt2/Flags.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/aapt2/Flags.cpp b/tools/aapt2/Flags.cpp
index 6ae5af7bb92a..9435396991df 100644
--- a/tools/aapt2/Flags.cpp
+++ b/tools/aapt2/Flags.cpp
@@ -16,6 +16,7 @@
#include "Flags.h"
#include "util/StringPiece.h"
+#include "util/Util.h"
#include <iomanip>
#include <iostream>
@@ -94,7 +95,14 @@ void Flags::usage(const StringPiece& command, std::ostream* out) {
if (flag.numArgs > 0) {
argLine += " arg";
}
- *out << " " << std::setw(30) << std::left << argLine << flag.description << "\n";
+
+ // 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')) {
+ *out << " " << std::setw(30) << std::left << argLine << line << "\n";
+ argLine = " ";
+ }
}
*out << " " << std::setw(30) << std::left << "-h" << "Displays this help menu\n";
out->flush();