mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-19 11:33:51 +08:00
command parser shortcuts e.g. 'd p' will call 'data plot' (from rumpeltux)
This commit is contained in:
parent
da17fa0ebc
commit
5d5311a223
1 changed files with 15 additions and 0 deletions
|
@ -25,6 +25,21 @@ void CmdsParse(const command_t Commands[], const char *Cmd)
|
|||
int i = 0;
|
||||
while (Commands[i].Name && strcmp(Commands[i].Name, cmd_name))
|
||||
++i;
|
||||
|
||||
/* try to find exactly one prefix-match */
|
||||
if(!Commands[i].Name) {
|
||||
int last_match = 0;
|
||||
int matches = 0;
|
||||
|
||||
for(i=0;Commands[i].Name;i++) {
|
||||
if( !strncmp(Commands[i].Name, cmd_name, strlen(cmd_name)) ) {
|
||||
last_match = i;
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
if(matches == 1) i=last_match;
|
||||
}
|
||||
|
||||
if (Commands[i].Name)
|
||||
Commands[i].Parse(Cmd + len);
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue