Skip to content

Commit 5c6d858

Browse files
committed
Non-argparse commands called as methods of PyscriptBridge now go through onecmd_plus_hooks
1 parent 3dcff64 commit 5c6d858

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd2/pyscript_bridge.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,12 @@ def __getattr__(self, item: str):
310310
else:
311311
# Command doesn't use argparse, we will accept parameters in the form of a command string
312312
def wrap_func(args=''):
313-
return _exec_cmd(self._cmd2_app, functools.partial(func, args), self.cmd_echo)
313+
command = item
314+
if args:
315+
command += ' ' + args
316+
return _exec_cmd(self._cmd2_app,
317+
functools.partial(self._cmd2_app.onecmd_plus_hooks, command + '\n'),
318+
self.cmd_echo)
314319

315320
return wrap_func
316321
else:

0 commit comments

Comments
 (0)