Fix up plugin argument help messages.

This commit is contained in:
Mike Auty
2017-06-20 17:44:59 +01:00
parent df527d2f00
commit e1c1981ed7
+4 -1
View File
@@ -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