Skip to content

Commit

Permalink
Make suggested changes by gcmoreira
Browse files Browse the repository at this point in the history
  • Loading branch information
ikelos committed Aug 1, 2024
1 parent d576f8c commit e6308a6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion volatility3/cli/volargparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ def _match_argument(self, action, arg_strings_pattern) -> int:
return len(match.group(1))

def _check_value(self, action: argparse.Action, value: Any) -> None:
"""This is called to ensure a value is correct/valid
This fails when we want to accept partial values for the plugin name,
so we disable the check (which will throw ArgumentErrors for failed checks)
but only for our plugin subparser, so all other arguments are checked correctly
"""
if not isinstance(action, HelpfulSubparserAction):
return super()._check_value(action, value)
super()._check_value(action, value)
return None

0 comments on commit e6308a6

Please sign in to comment.