script list: recurse in subdirs

This commit is contained in:
Philippe Teuwen
2020-08-13 23:09:46 +02:00
parent 80d9b4c5de
commit 6d3c1d0223
2 changed files with 30 additions and 10 deletions

View File

@@ -7,7 +7,7 @@
//-----------------------------------------------------------------------------
// Some lua scripting glue to proxmark core.
//-----------------------------------------------------------------------------
// 2020, added Python support (@iceman100)
// 2020, added Python support (@iceman1001)
#include <stdlib.h>
@@ -192,14 +192,17 @@ static void set_python_paths(void) {
*/
static int CmdScriptList(const char *Cmd) {
(void)Cmd; // Cmd is not used so far
PrintAndLogEx(NORMAL, "\n" _YELLOW_("[ Lua scripts ]"));
int ret = searchAndList(LUA_SCRIPTS_SUBDIR, ".lua");
if (ret != PM3_SUCCESS)
return ret;
PrintAndLogEx(NORMAL, "\n" _YELLOW_("[ Cmd scripts ]"));
ret = searchAndList(CMD_SCRIPTS_SUBDIR, ".cmd");
if (ret != PM3_SUCCESS)
return ret;
#ifdef HAVE_PYTHON
PrintAndLogEx(NORMAL, "\n" _YELLOW_("[ Python scripts ]"));
return searchAndList(PYTHON_SCRIPTS_SUBDIR, ".py");
#else
return ret;