Skip to content

Commit 0bda154

Browse files
committed
Clarify the documentation a little
1 parent e6308a6 commit 0bda154

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

volatility3/cli/volargparse.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,16 @@ def _match_argument(self, action, arg_strings_pattern) -> int:
101101

102102
def _check_value(self, action: argparse.Action, value: Any) -> None:
103103
"""This is called to ensure a value is correct/valid
104-
This fails when we want to accept partial values for the plugin name,
105-
so we disable the check (which will throw ArgumentErrors for failed checks)
106-
but only for our plugin subparser, so all other arguments are checked correctly
104+
105+
In normal operation, it would check that a value provided is valid and return None
106+
If it was not valid, it would throw an ArgumentError
107+
108+
When people provide a partial plugin name, we want to look for a matching plugin name
109+
which happens in the HelpfulSubparserAction's __call_method
110+
111+
To get there without tripping the check_value failure, we have to prevent the exception
112+
being thrown when the value is a HelpfulSubparserAction. This therefore affects no other
113+
checks for normal parameters.
107114
"""
108115
if not isinstance(action, HelpfulSubparserAction):
109116
super()._check_value(action, value)

0 commit comments

Comments
 (0)