lshal: add HelpCommand
Add *Command::usage() function for each Command and let
Lshal class to call them.
Suppress output from getopt_long and write our own
error message to customized error stream (for testing).
Test: lshal_test
Test: lshal --help
Change-Id: I8f5847c84a3e01af29fa85871479cab3baeb5312
diff --git a/cmds/lshal/DebugCommand.h b/cmds/lshal/DebugCommand.h
index afa5e97..6b70713 100644
--- a/cmds/lshal/DebugCommand.h
+++ b/cmds/lshal/DebugCommand.h
@@ -33,9 +33,10 @@
public:
DebugCommand(Lshal &lshal) : Command(lshal) {}
~DebugCommand() = default;
- Status main(const std::string &command, const Arg &arg) override;
+ Status main(const Arg &arg) override;
+ void usage() const override;
private:
- Status parseArgs(const std::string &command, const Arg &arg);
+ Status parseArgs(const Arg &arg);
std::string mInterfaceName;
std::vector<std::string> mOptions;