mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-11-11 18:33:18 +08: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] == '#')
|
||||
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;
|
||||
while (Commands[i].Name) {
|
||||
if (0 == strcmp(Commands[i].Name, cmd_name)) {
|
||||
if (Commands[i].IsAvailable()) {
|
||||
if (request_help || Commands[i].IsAvailable()) {
|
||||
break;
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, "This command is " _YELLOW_("not available") " in this mode");
|
||||
|
|
Loading…
Reference in a new issue