From 8801b8cba5dc8c91b22d502b6d82959531cb596e Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Sun, 5 May 2019 22:31:45 -0400 Subject: Broke _complete_statement into 2 functions. Fixed issue where terminators could not be used in alias/macro values. --- cmd2/utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cmd2/utils.py') diff --git a/cmd2/utils.py b/cmd2/utils.py index 44a58c35..e8e8a611 100644 --- a/cmd2/utils.py +++ b/cmd2/utils.py @@ -262,15 +262,16 @@ def natural_sort(list_to_sort: Iterable[str]) -> List[str]: return sorted(list_to_sort, key=natural_keys) -def unquote_redirection_tokens(args: List[str]) -> None: +def unquote_specific_tokens(args: List[str], tokens_to_unquote: List[str]) -> None: """ - Unquote redirection tokens in a list of command-line arguments - This is used when redirection tokens have to be passed to another command + Unquote a specific tokens in a list of command-line arguments + This is used when certain tokens have to be passed to another command :param args: the command line args + :param tokens_to_unquote: the tokens, which if present in args, to unquote """ for i, arg in enumerate(args): unquoted_arg = strip_quotes(arg) - if unquoted_arg in constants.REDIRECTION_TOKENS: + if unquoted_arg in tokens_to_unquote: args[i] = unquoted_arg -- cgit v1.2.1