Skip to content

Commit a39955a

Browse files
committed
improve function menu
1 parent cf84808 commit a39955a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/warnet/plugin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def run(plugin_name: str, function_name: str, json_dict: str):
155155
if not function_answer:
156156
sys.exit(0)
157157
function_name_with_doc = function_answer.get("func")
158-
function_name = function_name_with_doc.split("(")[0].strip()
158+
function_name = function_name_with_doc.split("\t")[0].strip()
159159

160160
func = get_func(function_name=function_name, plugin_name=plugin_name)
161161
hints = get_type_hints(func)
@@ -532,6 +532,7 @@ def format_func_with_docstring(func: Callable[..., Any]) -> str:
532532
if func.__doc__:
533533
doc = func.__doc__.replace("\n", " ")
534534
doc = doc[:96]
535-
return f"{name:<25} ({doc})"
535+
doc = click.style(doc, italic=True)
536+
return f"{name:<25}\t{doc}"
536537
else:
537538
return name

0 commit comments

Comments
 (0)