diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-09-26 14:37:13 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-09-26 14:37:13 -0400 |
commit | 8aeb29cf1fd027093b87b8f9f9c640cf50595db7 (patch) | |
tree | 23cb1ef06b4f9e52fe8b6da0b7e9f51a05e609e1 /cmd2/utils.py | |
parent | 149f6eba2620b1623f6071227318450c779b2b50 (diff) | |
parent | c8983d9d6df4d057672166a7e8df544199788b9a (diff) | |
download | cmd2-git-8aeb29cf1fd027093b87b8f9f9c640cf50595db7.tar.gz |
Merge branch 'macro' into argparse_conversion
Diffstat (limited to 'cmd2/utils.py')
-rw-r--r-- | cmd2/utils.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cmd2/utils.py b/cmd2/utils.py index 3527236f..a20f0b66 100644 --- a/cmd2/utils.py +++ b/cmd2/utils.py @@ -304,3 +304,15 @@ class StdSim(object): return self.__dict__[item] else: return getattr(self.inner_stream, item) + + +def unquote_redirection_tokens(args: List[str]) -> None: + """ + Used to unquote redirection tokens in a list of command line arguments + This is used when redirection tokens have to be passed to another command + :param args: the command line args + """ + for i, arg in enumerate(args): + unquoted_arg = strip_quotes(arg) + if unquoted_arg in constants.REDIRECTION_TOKENS: + args[i] = unquoted_arg |