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/ListCommand.h b/cmds/lshal/ListCommand.h
index 8d25d94..6defb0a 100644
--- a/cmds/lshal/ListCommand.h
+++ b/cmds/lshal/ListCommand.h
@@ -47,9 +47,10 @@
public:
ListCommand(Lshal &lshal) : Command(lshal) {}
virtual ~ListCommand() = default;
- Status main(const std::string &command, const Arg &arg) override;
+ Status main(const Arg &arg) override;
+ void usage() const override;
protected:
- Status parseArgs(const std::string &command, const Arg &arg);
+ Status parseArgs(const Arg &arg);
Status fetch();
void postprocess();
Status dump();