summaryrefslogtreecommitdiff
path: root/cmd2/constants.py
diff options
context:
space:
mode:
authorkotfu <kotfu@kotfu.net>2018-05-23 20:59:26 -0600
committerkotfu <kotfu@kotfu.net>2018-05-23 20:59:26 -0600
commit1a70b90f375997751bc7df16b5e3f58c6194c71b (patch)
tree1abe43d088060e24bb889e3db19fc5a1a4a82562 /cmd2/constants.py
parentb1516f4b09518bb6d33abfeb14e1459ed03f34d8 (diff)
parent5d64ebee348aeffb02fc385f903c9af431e3721b (diff)
downloadcmd2-git-1a70b90f375997751bc7df16b5e3f58c6194c71b.tar.gz
Merge branch 'master' into speedup_import
# Conflicts: # cmd2/cmd2.py # tests/test_completion.py # tests/test_submenu.py
Diffstat (limited to 'cmd2/constants.py')
-rw-r--r--cmd2/constants.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmd2/constants.py b/cmd2/constants.py
index 838650e5..b829000f 100644
--- a/cmd2/constants.py
+++ b/cmd2/constants.py
@@ -4,9 +4,14 @@
import re
-# Used for command parsing, tab completion and word breaks. Do not change.
+# Used for command parsing, output redirection, tab completion and word
+# breaks. Do not change.
QUOTES = ['"', "'"]
-REDIRECTION_CHARS = ['|', '>']
+REDIRECTION_PIPE = '|'
+REDIRECTION_OUTPUT = '>'
+REDIRECTION_APPEND = '>>'
+REDIRECTION_CHARS = [REDIRECTION_PIPE, REDIRECTION_OUTPUT]
+REDIRECTION_TOKENS = [REDIRECTION_PIPE, REDIRECTION_OUTPUT, REDIRECTION_APPEND]
# Regular expression to match ANSI escape codes
ANSI_ESCAPE_RE = re.compile(r'\x1b[^m]*m')