Skip to content

Commit b4f8468

Browse files
committed
minor plugin cleanups
1 parent f6871ed commit b4f8468

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/warnet/plugin.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def toggle(plugin: str):
103103
@click.argument("plugin_name", type=str, default="")
104104
@click.argument("function_name", type=str, default="")
105105
@click.option(
106-
"--params", type=str, default="", help="Paramter data to be fed to the plugin function"
106+
"--params", type=str, default="", help="Parameter data to be fed to the plugin function"
107107
)
108108
def run(plugin_name: str, function_name: str, params: str):
109109
"""Explore and run plugins
@@ -206,7 +206,7 @@ def run(plugin_name: str, function_name: str, params: str):
206206
)
207207
else:
208208
click.secho(
209-
f"\nwarnet plugin run {plugin_name} {function_name} --json-input '{json.dumps(params)}'",
209+
f"\nwarnet plugin run {plugin_name} {function_name} --params '{json.dumps(params)}'",
210210
fg="green",
211211
)
212212
else:
@@ -221,17 +221,15 @@ def execute_function_with_params(func: Callable[..., Any], params: dict | list):
221221
try:
222222
return_value = func(**params)
223223
if return_value is not None:
224-
jsonified = json.dumps(return_value)
225-
print(f"'{jsonified}'")
224+
print(json.dumps(return_value))
226225
except Exception as e:
227226
click.secho(f"Exception: {e}", fg="yellow")
228227
sys.exit(1)
229228
case list():
230229
try:
231230
return_value = func(*params)
232231
if return_value is not None:
233-
jsonified = json.dumps(return_value)
234-
print(f"'{jsonified}'")
232+
print(json.dumps(return_value))
235233
except Exception as e:
236234
click.secho(f"Exception: {e}", fg="yellow")
237235
sys.exit(1)

0 commit comments

Comments
 (0)