Add "help" to qshell for qurt

Fixes issue #5111
This commit is contained in:
Eric Ye 2016-07-20 16:07:04 -07:00 committed by Julian Oes
parent 7399e60e96
commit 76d74640ae
1 changed files with 5 additions and 0 deletions

View File

@ -62,6 +62,7 @@
#include "DriverFramework.hpp"
extern void init_app_map(std::map<std::string, px4_main_t> &apps);
extern void list_builtins(std::map<std::string, px4_main_t> &apps);
using std::map;
using std::string;
@ -146,6 +147,10 @@ int QShell::run_cmd(const std::vector<std::string> &appargs)
// command is appargs[0]
std::string command = appargs[0];
if (command.compare("help") == 0) {
list_builtins(apps);
}
//replaces app.find with iterator code to avoid null pointer exception
for (map<string, px4_main_t>::iterator it = apps.begin(); it != apps.end(); ++it) {
if (it->first == command) {