diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py --- a/lldb/examples/python/crashlog.py +++ b/lldb/examples/python/crashlog.py @@ -1199,6 +1199,11 @@ def SymbolicateCrashLogs(debugger, command_args): option_parser = CrashLogOptionParser() + + if not len(command_args): + option_parser.print_help() + return + try: (options, args) = option_parser.parse_args(command_args) except: diff --git a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/no-args.test b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/no-args.test new file mode 100644 --- /dev/null +++ b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/no-args.test @@ -0,0 +1,9 @@ +# RUN: %lldb -o 'command script import lldb.macosx.crashlog' -o 'crashlog' 2>&1 | FileCheck %s + +# CHECK: "crashlog" {{.*}} commands have been installed, use the "--help" options on these commands + +# CHECK: Usage: crashlog [options] [FILE ...] +# CHECK: Symbolicate one or more darwin crash log files to provide source file and line +# CHECK: Options: +# CHECK: -h, --help show this help message and exit +