allow specifying integers as 0x in ListRequirement

This commit is contained in:
Abyss Watcher
2024-03-01 14:18:30 +01:00
parent 887747e3ce
commit d56ccbfd0b
+5 -1
View File
@@ -827,7 +827,11 @@ class CommandLine:
requirement,
volatility3.framework.configuration.requirements.ListRequirement,
):
additional["type"] = requirement.element_type
# Allow a list of integers, specified with convenient 0x hexadecimal format
if requirement.element_type == int:
additional["type"] = lambda x: int(x, 0)
else:
additional["type"] = requirement.element_type
nargs = "*" if requirement.optional else "+"
additional["nargs"] = nargs
elif isinstance(