diff options
Diffstat (limited to 'cmds/lshal/DebugCommand.cpp')
-rw-r--r-- | cmds/lshal/DebugCommand.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/cmds/lshal/DebugCommand.cpp b/cmds/lshal/DebugCommand.cpp index 672cad67cb..622f866617 100644 --- a/cmds/lshal/DebugCommand.cpp +++ b/cmds/lshal/DebugCommand.cpp @@ -21,12 +21,16 @@ namespace android { namespace lshal { -DebugCommand::DebugCommand(Lshal &lshal) : mLshal(lshal) { +std::string DebugCommand::getName() const { + return "debug"; } -Status DebugCommand::parseArgs(const std::string &command, const Arg &arg) { +std::string DebugCommand::getSimpleDescription() const { + return "Debug a specified HAL."; +} + +Status DebugCommand::parseArgs(const Arg &arg) { if (optind >= arg.argc) { - mLshal.usage(command); return USAGE; } mInterfaceName = arg.argv[optind]; @@ -37,8 +41,8 @@ Status DebugCommand::parseArgs(const std::string &command, const Arg &arg) { return OK; } -Status DebugCommand::main(const std::string &command, const Arg &arg) { - Status status = parseArgs(command, arg); +Status DebugCommand::main(const Arg &arg) { + Status status = parseArgs(arg); if (status != OK) { return status; } @@ -49,6 +53,19 @@ Status DebugCommand::main(const std::string &command, const Arg &arg) { mLshal.err()); } +void DebugCommand::usage() const { + + static const std::string debug = + "debug:\n" + " lshal debug <interface> [options [options [...]]] \n" + " Print debug information of a specified interface.\n" + " <inteface>: Format is `android.hardware.foo@1.0::IFoo/default`.\n" + " If instance name is missing `default` is used.\n" + " options: space separated options to IBase::debug.\n"; + + mLshal.err() << debug; +} + } // namespace lshal } // namespace android |