mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
fix commands.json generator, 608 -> 687 commands!
This commit is contained in:
parent
c5658f2a0b
commit
fbc60ccbbb
3 changed files with 1210 additions and 759 deletions
|
@ -68,13 +68,13 @@ def build_help_regex():
|
||||||
# Reads if the command is available offline
|
# Reads if the command is available offline
|
||||||
re_offline = r'available offline: (?P<offline>yes|no)\n+'
|
re_offline = r'available offline: (?P<offline>yes|no)\n+'
|
||||||
# Reads the description lines
|
# Reads the description lines
|
||||||
re_description = r'(?P<description>(.|\n)+?)\n+'
|
re_description = r'(?P<description>(?:.+\n)+)\n+'
|
||||||
# Reads the usage string
|
# Reads the usage string
|
||||||
re_usage = r'usage:\n(?P<usage>(?:.+\n)+)\n+'
|
re_usage = r'(?:usage:\n(?P<usage>(?:.+\n)+)\n+)?'
|
||||||
# Reads the options and there individual descriptions
|
# Reads the options and there individual descriptions
|
||||||
re_options = r'options:\n(?P<options>(?:.+\n)+)\n'
|
re_options = r'(?:options:\n(?P<options>(?:.+\n)+)\n+)?'
|
||||||
# Reads the notes and examples
|
# Reads the notes and examples
|
||||||
re_notes = r'examples\/notes:\n(?P<notes>(?:.+\n)+)'
|
re_notes = r'(?:examples\/notes:\n(?P<notes>(?:.+\n)+)\n+)?'
|
||||||
# Combine them into a single regex object
|
# Combine them into a single regex object
|
||||||
re_full = re.compile(re_command+re_offline+re_description+re_usage+re_options+re_notes, re.MULTILINE);
|
re_full = re.compile(re_command+re_offline+re_description+re_usage+re_options+re_notes, re.MULTILINE);
|
||||||
return re_full
|
return re_full
|
||||||
|
@ -181,6 +181,8 @@ def remove_extra_whitespace(text):
|
||||||
|
|
||||||
def text_to_oneliner(text):
|
def text_to_oneliner(text):
|
||||||
"""Converts a multi line string into a single line string and removes extra whitespace"""
|
"""Converts a multi line string into a single line string and removes extra whitespace"""
|
||||||
|
if text is None:
|
||||||
|
return ""
|
||||||
# Ensure input is a string
|
# Ensure input is a string
|
||||||
text = str(text)
|
text = str(text)
|
||||||
# Replace newlines with spaces
|
# Replace newlines with spaces
|
||||||
|
@ -192,6 +194,8 @@ def text_to_oneliner(text):
|
||||||
|
|
||||||
def text_to_list(text):
|
def text_to_list(text):
|
||||||
"""Converts a multi line string into a list of lines and removes extra whitespace"""
|
"""Converts a multi line string into a list of lines and removes extra whitespace"""
|
||||||
|
if text is None:
|
||||||
|
return []
|
||||||
# Ensure input is a string
|
# Ensure input is a string
|
||||||
text = str(text)
|
text = str(text)
|
||||||
# Get all the lines
|
# Get all the lines
|
||||||
|
|
|
@ -206,6 +206,8 @@ void CmdsHelp(const command_t Commands[]) {
|
||||||
}
|
}
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
// empty line needed for the help2json parser
|
||||||
|
PrintAndLogEx(NORMAL, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
int CmdsParse(const command_t Commands[], const char *Cmd) {
|
int CmdsParse(const command_t Commands[], const char *Cmd) {
|
||||||
|
|
1955
doc/commands.json
1955
doc/commands.json
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue