mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 05:13:46 -07:00
Allow to see help offline
This commit is contained in:
parent
68e8705278
commit
7e68064446
1 changed files with 7 additions and 1 deletions
|
@ -240,10 +240,16 @@ int CmdsParse(const command_t Commands[], const char *Cmd) {
|
||||||
if (cmd_name[0] == '#')
|
if (cmd_name[0] == '#')
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
|
|
||||||
|
// find args, check for -h / --help
|
||||||
|
int tmplen = len;
|
||||||
|
while (Cmd[tmplen] == ' ')
|
||||||
|
++tmplen;
|
||||||
|
bool request_help = (strcmp(Cmd+tmplen, "-h") == 0) || (strcmp(Cmd+tmplen, "--help") == 0);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (Commands[i].Name) {
|
while (Commands[i].Name) {
|
||||||
if (0 == strcmp(Commands[i].Name, cmd_name)) {
|
if (0 == strcmp(Commands[i].Name, cmd_name)) {
|
||||||
if (Commands[i].IsAvailable()) {
|
if (request_help || Commands[i].IsAvailable()) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(WARNING, "This command is " _YELLOW_("not available") " in this mode");
|
PrintAndLogEx(WARNING, "This command is " _YELLOW_("not available") " in this mode");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue