summaryrefslogtreecommitdiff
path: root/cmd2/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2/utils.py')
-rw-r--r--cmd2/utils.py12
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