Merge pull request #1733 from volatilityfoundation/add-script-only-volshell-feature

Add a --script-only flag that exits after the given volshell script i…
This commit is contained in:
ikelos
2025-03-25 00:51:50 +00:00
committed by GitHub
+10 -1
View File
@@ -60,7 +60,13 @@ class Volshell(interfaces.plugins.PluginInterface):
description="File to load and execute at start",
default=None,
optional=True,
)
),
requirements.BooleanRequirement(
name="script-only",
description="Exit volshell after the script specified in --script completes",
default=False,
optional=True,
),
]
return reqs + [
requirements.TranslationLayerRequirement(
@@ -135,6 +141,9 @@ class Volshell(interfaces.plugins.PluginInterface):
if self.config.get("script", None) is not None:
self.run_script(location=self.config["script"])
if self.config.get("script-only"):
exit()
if has_ipython:
self.__console()
else: