summaryrefslogtreecommitdiff
path: root/lldb/examples/python/cmdtemplate.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/examples/python/cmdtemplate.py')
-rw-r--r--lldb/examples/python/cmdtemplate.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lldb/examples/python/cmdtemplate.py b/lldb/examples/python/cmdtemplate.py
index a9fbe0b40e19..be4c2da53ee0 100644
--- a/lldb/examples/python/cmdtemplate.py
+++ b/lldb/examples/python/cmdtemplate.py
@@ -74,6 +74,11 @@ class FrameStatCommand(ParsedCommand):
dest = "statics",
default = True,
)
+ ov_parser.add_option(
+ "t",
+ "test-flag",
+ help="test a flag value.",
+ )
def get_repeat_command(self, args):
"""As an example, make the command not auto-repeat:"""
@@ -123,6 +128,11 @@ class FrameStatCommand(ParsedCommand):
% (variables_count, total_size, average_size),
file=result,
)
+ if ov_parser.was_set("test-flag"):
+ print("Got the test flag")
+ else:
+ print("Got no test flag")
+
# not returning anything is akin to returning success