mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
Add -h/--help support to last commands
This commit is contained in:
parent
d2246e6606
commit
11c7ead732
3 changed files with 46 additions and 4 deletions
|
@ -96,7 +96,17 @@ static void arg_add_t55xx_downloadlink(void *at[], uint8_t *idx, uint8_t show, u
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CmdT55xxCloneHelp(const char *Cmd) {
|
static int CmdT55xxCloneHelp(const char *Cmd) {
|
||||||
(void)Cmd; // Cmd is not used so far
|
CLIParserContext *ctx;
|
||||||
|
CLIParserInit(&ctx, "lf t55xx clonehelp",
|
||||||
|
"Display a list of available commands for cloning specific techs on T5xx tags",
|
||||||
|
"lf t55xx clonehelp"
|
||||||
|
);
|
||||||
|
void *argtable[] = {
|
||||||
|
arg_param_begin,
|
||||||
|
arg_param_end
|
||||||
|
};
|
||||||
|
CLIExecWithReturn(ctx, Cmd, argtable, true);
|
||||||
|
CLIParserFree(ctx);
|
||||||
PrintAndLogEx(NORMAL, "For cloning specific techs on T55xx tags, see commands available in corresponding LF sub-menus, e.g.:");
|
PrintAndLogEx(NORMAL, "For cloning specific techs on T55xx tags, see commands available in corresponding LF sub-menus, e.g.:");
|
||||||
PrintAndLogEx(NORMAL, _GREEN_("lf awid clone"));
|
PrintAndLogEx(NORMAL, _GREEN_("lf awid clone"));
|
||||||
PrintAndLogEx(NORMAL, _GREEN_("lf destron clone"));
|
PrintAndLogEx(NORMAL, _GREEN_("lf destron clone"));
|
||||||
|
|
|
@ -263,7 +263,17 @@ static int CmdMsleep(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CmdQuit(const char *Cmd) {
|
static int CmdQuit(const char *Cmd) {
|
||||||
(void)Cmd; // Cmd is not used so far
|
CLIParserContext *ctx;
|
||||||
|
CLIParserInit(&ctx, "quit",
|
||||||
|
"Quit the Proxmark3 client terminal",
|
||||||
|
"quit"
|
||||||
|
);
|
||||||
|
void *argtable[] = {
|
||||||
|
arg_param_begin,
|
||||||
|
arg_param_end
|
||||||
|
};
|
||||||
|
CLIExecWithReturn(ctx, Cmd, argtable, true);
|
||||||
|
CLIParserFree(ctx);
|
||||||
return PM3_EFATAL;
|
return PM3_EFATAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include "proxmark3.h"
|
#include "proxmark3.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "fileutils.h"
|
#include "fileutils.h"
|
||||||
|
#include "cliparser.h" // cliparsing
|
||||||
|
|
||||||
#ifdef HAVE_LUA_SWIG
|
#ifdef HAVE_LUA_SWIG
|
||||||
extern int luaopen_pm3(lua_State *L);
|
extern int luaopen_pm3(lua_State *L);
|
||||||
|
@ -198,7 +199,17 @@ static void set_python_paths(void) {
|
||||||
* ending with .lua
|
* ending with .lua
|
||||||
*/
|
*/
|
||||||
static int CmdScriptList(const char *Cmd) {
|
static int CmdScriptList(const char *Cmd) {
|
||||||
(void)Cmd; // Cmd is not used so far
|
CLIParserContext *ctx;
|
||||||
|
CLIParserInit(&ctx, "script list",
|
||||||
|
"List available Lua, Cmd and Python scripts",
|
||||||
|
"script list"
|
||||||
|
);
|
||||||
|
void *argtable[] = {
|
||||||
|
arg_param_begin,
|
||||||
|
arg_param_end
|
||||||
|
};
|
||||||
|
CLIExecWithReturn(ctx, Cmd, argtable, true);
|
||||||
|
CLIParserFree(ctx);
|
||||||
PrintAndLogEx(NORMAL, "\n" _YELLOW_("[ Lua scripts ]"));
|
PrintAndLogEx(NORMAL, "\n" _YELLOW_("[ Lua scripts ]"));
|
||||||
int ret = searchAndList(LUA_SCRIPTS_SUBDIR, ".lua");
|
int ret = searchAndList(LUA_SCRIPTS_SUBDIR, ".lua");
|
||||||
if (ret != PM3_SUCCESS)
|
if (ret != PM3_SUCCESS)
|
||||||
|
@ -223,7 +234,18 @@ static int CmdScriptList(const char *Cmd) {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
static int CmdScriptRun(const char *Cmd) {
|
static int CmdScriptRun(const char *Cmd) {
|
||||||
|
CLIParserContext *ctx;
|
||||||
|
CLIParserInit(&ctx, "script run",
|
||||||
|
"Run a Lua, Cmd or Python script",
|
||||||
|
"script run my_script.lua --my_script_args"
|
||||||
|
);
|
||||||
|
void *argtable[] = {
|
||||||
|
arg_param_begin,
|
||||||
|
arg_param_end
|
||||||
|
};
|
||||||
|
CLIExecWithReturn(ctx, Cmd, argtable, true);
|
||||||
|
CLIParserFree(ctx);
|
||||||
|
// TODO possible to handle it with cliparser?
|
||||||
char preferredName[128] = {0};
|
char preferredName[128] = {0};
|
||||||
char arguments[256] = {0};
|
char arguments[256] = {0};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue