summaryrefslogtreecommitdiff
path: root/cmd2/exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2/exceptions.py')
-rw-r--r--cmd2/exceptions.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd2/exceptions.py b/cmd2/exceptions.py
index d0a922db..8a7fd81f 100644
--- a/cmd2/exceptions.py
+++ b/cmd2/exceptions.py
@@ -16,10 +16,10 @@ class SkipPostcommandHooks(Exception):
class Cmd2ArgparseError(SkipPostcommandHooks):
"""
- A ``SkipPostcommandHooks`` exception for when a command fails parsing its arguments.
- This is raised by argparse decorators but can also be raised by command functions.
- If a command function still needs to run post command hooks when parsing fails,
- just return instead of raising an exception.
+ A ``SkipPostcommandHooks`` exception for when a command fails to parse its arguments.
+ Normally argparse raises a SystemExit exception in these cases. To avoid stopping the command
+ loop, catch the SystemExit and raise this instead. If you still need to run post command hooks
+ after parsing fails, just return instead of raising an exception.
"""
pass