Add lshal --neat option
... that doesn't output explanatory text and title line.
Test: lshal --neat
Test: lshal
Test: lshal --neat -itrpc
Change-Id: I269a5d284903dc0e9bc3be96379ed41aecea8ddb
Fixes: 38211518
diff --git a/cmds/lshal/ListCommand.cpp b/cmds/lshal/ListCommand.cpp
index 710b6e4..38b406c 100644
--- a/cmds/lshal/ListCommand.cpp
+++ b/cmds/lshal/ListCommand.cpp
@@ -344,10 +344,14 @@
mImplementationsTable.description =
"All available passthrough implementations (all -impl.so files)";
forEachTable([this] (const Table &table) {
- mOut << table.description << std::endl;
+ if (!mNeat) {
+ mOut << table.description << std::endl;
+ }
mOut << std::left;
- printLine("Interface", "Transport", "Arch", "Server", "Server CMD",
- "PTR", "Clients", "Clients CMD");
+ if (!mNeat) {
+ printLine("Interface", "Transport", "Arch", "Server", "Server CMD",
+ "PTR", "Clients", "Clients CMD");
+ }
for (const auto &entry : table) {
printLine(entry.interfaceName,
@@ -369,7 +373,9 @@
NullableOStream<std::ostream>(nullptr));
}
}
- mOut << std::endl;
+ if (!mNeat) {
+ mOut << std::endl;
+ }
});
}
@@ -593,6 +599,7 @@
// long options without short alternatives
{"sort", required_argument, 0, 's' },
{"init-vintf",optional_argument, 0, 'v' },
+ {"neat", no_argument, 0, 'n' },
{ 0, 0, 0, 0 }
};
@@ -672,6 +679,10 @@
}
break;
}
+ case 'n': {
+ mNeat = true;
+ break;
+ }
case 'h': // falls through
default: // see unrecognized options
mLshal.usage(command);