Being explicit about how ignoring optparse's exceptions is not a best principle
llvm-svn: 176059
diff --git a/lldb/examples/python/cmdtemplate.py b/lldb/examples/python/cmdtemplate.py
index dc8e6b1..9936d0e 100644
--- a/lldb/examples/python/cmdtemplate.py
+++ b/lldb/examples/python/cmdtemplate.py
@@ -38,6 +38,8 @@
try:
(options, args) = parser.parse_args(command_args)
except:
+ # if you don't handle exceptions, passing an incorrect argument to the OptionParser will cause LLDB to exit
+ # (courtesy of OptParse dealing with argument errors by throwing SystemExit)
result.SetStatus (lldb.eReturnStatusFailed)
return