Swap the Statement parameter with one or more decorator-specific parameters. :param args: The original positional arguments :param search_arg: The argument to search for (usually the Statement) :param replace_arg: The arguments to substitute in :return: The new set of arguments to p
(args: Sequence[Any], search_arg: Any, *replace_arg: Any)
| 95 | |
| 96 | |
| 97 | def _arg_swap(args: Sequence[Any], search_arg: Any, *replace_arg: Any) -> list[Any]: |
| 98 | """Swap the Statement parameter with one or more decorator-specific parameters. |
| 99 | |
| 100 | :param args: The original positional arguments |
| 101 | :param search_arg: The argument to search for (usually the Statement) |
| 102 | :param replace_arg: The arguments to substitute in |
| 103 | :return: The new set of arguments to pass to the command function |
| 104 | """ |
| 105 | index = args.index(search_arg) |
| 106 | args_list = list(args) |
| 107 | args_list[index : index + 1] = replace_arg |
| 108 | return args_list |
| 109 | |
| 110 | |
| 111 | # The standard cmd2 command function signature (e.g. do_command(self, statement)) |
no outgoing calls
no test coverage detected
searching dependent graphs…