summaryrefslogtreecommitdiff
path: root/cmd2/constants.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-10-31 12:11:38 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-10-31 12:11:38 -0400
commit48420deeceaeb5793d4e2616eec7ca2f67c545e0 (patch)
tree825d550028788c8fd95c6785fdb5ece7174dc5d2 /cmd2/constants.py
parent245dc33730d2a27bc9744be7cf36f176f5a0c10a (diff)
downloadcmd2-git-48420deeceaeb5793d4e2616eec7ca2f67c545e0.tar.gz
Moving a bit of code around to shrink cmd2.py
This includes moving cmd2 decorators into a new file called decorators.py Moved some constants from cmd2.py to constants.py
Diffstat (limited to 'cmd2/constants.py')
-rw-r--r--cmd2/constants.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/cmd2/constants.py b/cmd2/constants.py
index 9fd58b01..9e8e7780 100644
--- a/cmd2/constants.py
+++ b/cmd2/constants.py
@@ -16,3 +16,28 @@ MULTILINE_TERMINATOR = ';'
LINE_FEED = '\n'
DEFAULT_SHORTCUTS = {'?': 'help', '!': 'shell', '@': 'run_script', '@@': '_relative_run_script'}
+
+# Used as the command name placeholder in disabled command messages.
+COMMAND_NAME = "<COMMAND_NAME>"
+
+# All command functions start with this
+COMMAND_FUNC_PREFIX = 'do_'
+
+# All help functions start with this
+HELP_FUNC_PREFIX = 'help_'
+
+# All command completer functions start with this
+COMPLETER_FUNC_PREFIX = 'complete_'
+
+############################################################################################################
+# The following are optional attributes added to do_* command functions
+############################################################################################################
+
+# The custom help category a command belongs to
+CMD_ATTR_HELP_CATEGORY = 'help_category'
+
+# The argparse parser for the command
+CMD_ATTR_ARGPARSER = 'argparser'
+
+# Whether or not tokens are unquoted before sending to argparse
+CMD_ATTR_PRESERVE_QUOTES = 'preserve_quotes'