Implement simpleperf record/dumprecord subcommands.
(cherry picked from commit 9759e1b1ce76185aa539aeea2fb1cbd8382156e7)
Bug: 19483574
Change-Id: Id879713a75c2d3a6289d8847b95ee0bb4a2cc8a0
diff --git a/simpleperf/cmd_help.cpp b/simpleperf/cmd_help.cpp
index bf08dba..0f3839b 100644
--- a/simpleperf/cmd_help.cpp
+++ b/simpleperf/cmd_help.cpp
@@ -39,10 +39,10 @@
};
bool HelpCommand::Run(const std::vector<std::string>& args) {
- if (args.empty()) {
+ if (args.size() == 1) {
PrintShortHelp();
} else {
- Command* cmd = Command::FindCommandByName(args[0]);
+ Command* cmd = Command::FindCommandByName(args[1]);
if (cmd == nullptr) {
LOG(ERROR) << "malformed command line: can't find help string for unknown command " << args[0];
LOG(ERROR) << "try using \"--help\"";