summaryrefslogtreecommitdiff
path: root/cmd2/constants.py
diff options
context:
space:
mode:
authorkotfu <jared@kotfu.net>2018-05-10 14:36:40 -0600
committerGitHub <noreply@github.com>2018-05-10 14:36:40 -0600
commitb48d6b5eadfc6457acfcc578e21edcf9b86862cc (patch)
tree862840b5d797030374bc559ebdfed6465190eb08 /cmd2/constants.py
parent9d4d929709ffbcfcbd0974d8193c44d514f5a9b4 (diff)
parentceb3ef56e5c98e3af31de27a2ce43b64324c7e4e (diff)
downloadcmd2-git-b48d6b5eadfc6457acfcc578e21edcf9b86862cc.tar.gz
Merge pull request #398 from python-cmd2/remove_dynamic_redirectors
Remove cmd2.Cmd.redirector for #381
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')