Command function wrapper which translates command line into an argument list and calls actual command function. :param args: All positional arguments to this function. We're expecting there to be: cmd2_app, statement: Union[Statement, str]
(*args: Any, **kwargs: Any)
| 175 | |
| 176 | @functools.wraps(func) |
| 177 | def cmd_wrapper(*args: Any, **kwargs: Any) -> bool | None: |
| 178 | """Command function wrapper which translates command line into an argument list and calls actual command function. |
| 179 | |
| 180 | :param args: All positional arguments to this function. We're expecting there to be: |
| 181 | cmd2_app, statement: Union[Statement, str] |
| 182 | contiguously somewhere in the list |
| 183 | :param kwargs: any keyword arguments being passed to command function |
| 184 | :return: return value of command function |
| 185 | """ |
| 186 | cmd2_app, statement = _parse_positionals(args) |
| 187 | _, command_arg_list = cmd2_app.statement_parser.get_command_arg_list(command_name, statement, preserve_quotes) |
| 188 | func_arg_list = _arg_swap(args, statement, command_arg_list) |
| 189 | return func(*func_arg_list, **kwargs) |
| 190 | |
| 191 | command_name = func.__name__[len(constants.COMMAND_FUNC_PREFIX) :] |
| 192 | cmd_wrapper.__doc__ = func.__doc__ |
nothing calls this directly
no test coverage detected
searching dependent graphs…