diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-11-02 13:39:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-02 13:39:36 -0400 |
commit | a18eef6f6aa89280b5f9b92d4e681f22a438ff8b (patch) | |
tree | 6edce82378ac1fca1568c19ae4c723bb3ad4dbd4 /cmd2/constants.py | |
parent | 245dc33730d2a27bc9744be7cf36f176f5a0c10a (diff) | |
parent | 4ea04bc6e7d64d2e1f84ed2a512917576c715bcd (diff) | |
download | cmd2-git-a18eef6f6aa89280b5f9b92d4e681f22a438ff8b.tar.gz |
Merge pull request #798 from python-cmd2/refactoring
Refactoring
Diffstat (limited to 'cmd2/constants.py')
-rw-r--r-- | cmd2/constants.py | 25 |
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' |