From e1c1981ed7fa0570ea5e6e9d0c3bdb822dcbc99b Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Tue, 20 Jun 2017 17:44:59 +0100 Subject: [PATCH] Fix up plugin argument help messages. --- volatility/cli/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/volatility/cli/__init__.py b/volatility/cli/__init__.py index b12f2a995..1ffad0f1f 100644 --- a/volatility/cli/__init__.py +++ b/volatility/cli/__init__.py @@ -56,7 +56,10 @@ class CommandLine(object): default = "", type = str) parser.add_argument("-v", "--verbosity", help = "Increase output verbosity", default = 0, action = "count") - partial_args, _ = parser.parse_known_args() + # We have to filter out help, otherwise parse_known_args will trigger the help message before having + # processed the plugin choice or had the plugin subparser added. + known_args = [arg for arg in sys.argv if arg != '--help' and arg != '-h'] + partial_args, _ = parser.parse_known_args(known_args) if partial_args.plugins: volatility.plugins.__path__ = partial_args.plugins.split(";") + constants.PLUGINS_PATH