mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-04 21:23:57 +08:00
POSIX: added separators between commands run from shell
Output a separator and the command called to make the ouput easier to read. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -53,6 +53,7 @@ typedef int (*px4_main_t)(int argc, char *argv[]);
|
|||||||
static void run_cmd(const vector<string> &appargs) {
|
static void run_cmd(const vector<string> &appargs) {
|
||||||
// command is appargs[0]
|
// command is appargs[0]
|
||||||
string command = appargs[0];
|
string command = appargs[0];
|
||||||
|
cout << "----------------------------------\n";
|
||||||
if (apps.find(command) != apps.end()) {
|
if (apps.find(command) != apps.end()) {
|
||||||
const char *arg[appargs.size()+2];
|
const char *arg[appargs.size()+2];
|
||||||
|
|
||||||
@@ -62,11 +63,12 @@ static void run_cmd(const vector<string> &appargs) {
|
|||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
arg[i] = (char *)0;
|
arg[i] = (char *)0;
|
||||||
|
cout << "Running: " << command << "\n";
|
||||||
apps[command](i,(char **)arg);
|
apps[command](i,(char **)arg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cout << "Invalid command" << endl;
|
cout << "Invalid command: " << command << endl;
|
||||||
list_builtins();
|
list_builtins();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user