summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2020-08-25 09:16:34 -0700
committerAlex Light <allight@google.com>2020-09-02 17:21:58 +0000
commit0d47a82b11ea666fc3ef971b32be5a03ffadc452 (patch)
tree2bd3e50b0dae701470f92a713a875ab594b3d344 /cmdline
parent6624d58c11b43a10c802037bf1c5754ca276156c (diff)
Use help-text generator for dex2oat
The use of a static text blob makes keeping the dex2oat help text up to date difficult. Change to use the new cmdline help-text generator code. Test: dex2oat --help Change-Id: I1139cba2c773242e15f863d7efd2c7050c05ab4f
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/cmdline_parser.h10
-rw-r--r--cmdline/detail/cmdline_parse_argument_detail.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/cmdline/cmdline_parser.h b/cmdline/cmdline_parser.h
index 86e3b2c7df..22eb44c211 100644
--- a/cmdline/cmdline_parser.h
+++ b/cmdline/cmdline_parser.h
@@ -755,10 +755,12 @@ void CmdlineParser<TVariantMap, TVariantMapKey>::DumpHelp(VariableIndentationOut
vios.Stream();
}
}
- vios.Stream() << "The following arguments are ignored for compatibility:" << std::endl;
- ScopedIndentation si(&vios);
- for (auto ign : ignore_list_) {
- vios.Stream() << ign << std::endl;
+ if (!ignore_list_.empty()) {
+ vios.Stream() << "The following arguments are ignored for compatibility:" << std::endl;
+ ScopedIndentation si(&vios);
+ for (auto ign : ignore_list_) {
+ vios.Stream() << ign << std::endl;
+ }
}
}
diff --git a/cmdline/detail/cmdline_parse_argument_detail.h b/cmdline/detail/cmdline_parse_argument_detail.h
index f5cbda9a73..0f73a76b72 100644
--- a/cmdline/detail/cmdline_parse_argument_detail.h
+++ b/cmdline/detail/cmdline_parse_argument_detail.h
@@ -145,6 +145,8 @@ struct CmdlineParserArgumentInfo {
template <typename T = TArg> // Necessary to get SFINAE to kick in.
void DumpHelp(VariableIndentationOutputStream& vios) {
+ // Separate arguments
+ vios.Stream() << std::endl;
for (auto cname : names_) {
std::string_view name = cname;
auto& os = vios.Stream();