Skip to content

Commit 083dae7

Browse files
authored
Merge pull request #1733 from volatilityfoundation/add-script-only-volshell-feature
Add a --script-only flag that exits after the given volshell script i…
2 parents e527f76 + 003c139 commit 083dae7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

volatility3/cli/volshell/generic.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@ def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]
6060
description="File to load and execute at start",
6161
default=None,
6262
optional=True,
63-
)
63+
),
64+
requirements.BooleanRequirement(
65+
name="script-only",
66+
description="Exit volshell after the script specified in --script completes",
67+
default=False,
68+
optional=True,
69+
),
6470
]
6571
return reqs + [
6672
requirements.TranslationLayerRequirement(
@@ -135,6 +141,9 @@ def in_prompt_tokens(self, cli=None):
135141
if self.config.get("script", None) is not None:
136142
self.run_script(location=self.config["script"])
137143

144+
if self.config.get("script-only"):
145+
exit()
146+
138147
if has_ipython:
139148
self.__console()
140149
else:

0 commit comments

Comments
 (0)