[lldb/crashlog] Show help when the command is called without any argument

This patch changes the `crashlog` command behavior to print the help
message if no argument was provided with the command.

rdar://94576026

Differential Revision: https://reviews.llvm.org/D127362

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
This commit is contained in:
Med Ismail Bennani 2022-06-08 16:21:24 -07:00
parent 70f1021431
commit 5a9fa21ce8
2 changed files with 14 additions and 0 deletions

View file

@ -1199,6 +1199,11 @@ be disassembled and lookups can be performed using the addresses found in the cr
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:

View file

@ -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> [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