Add support for Python object commands to return custom short and long help by implementing
def get_short_help(self)
def get_long_help(self)
methods on the command object
Also, add a test case for this feature
llvm-svn: 232224
diff --git a/lldb/test/functionalities/command_script/welcome.py b/lldb/test/functionalities/command_script/welcome.py
index c444934..90bd0b8 100644
--- a/lldb/test/functionalities/command_script/welcome.py
+++ b/lldb/test/functionalities/command_script/welcome.py
@@ -1,12 +1,15 @@
import sys
-def welcome_impl(debugger, args, result, dict):
- """
- Just a docstring for welcome_impl
- A command that says hello to LLDB users
- """
- print >>result, ('Hello ' + args + ', welcome to LLDB');
- return None;
+class WelcomeCommand(object):
+ def __init__(self, debugger, session_dict):
+ pass
+
+ def get_short_help(self):
+ return "Just a docstring for welcome_impl\nA command that says hello to LLDB users"
+
+ def __call__(self, debugger, args, exe_ctx, result):
+ print >>result, ('Hello ' + args + ', welcome to LLDB');
+ return None;
def target_name_impl(debugger, args, result, dict):
target = debugger.GetSelectedTarget()