Fix segfault for wayvncctl help --command=bad-name
Signed-off-by: Jim Ramsay <i.am@jimramsay.com>pull/216/head
parent
522b1deb28
commit
d475e0e52f
|
@ -650,6 +650,10 @@ static int print_command_usage(const char* cmd_name,
|
||||||
struct option_parser* parent_options)
|
struct option_parser* parent_options)
|
||||||
{
|
{
|
||||||
struct cmd_info* info = ctl_command_by_name(cmd_name);
|
struct cmd_info* info = ctl_command_by_name(cmd_name);
|
||||||
|
if (!info) {
|
||||||
|
WARN("No such command \"%s\"\n", cmd_name);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
printf("Usage: wayvncctl [options] %s [parameters]\n\n%s\n\n", cmd_name,
|
printf("Usage: wayvncctl [options] %s [parameters]\n\n%s\n\n", cmd_name,
|
||||||
info->description);
|
info->description);
|
||||||
option_parser_print_options(cmd_options, stdout);
|
option_parser_print_options(cmd_options, stdout);
|
||||||
|
|
Loading…
Reference in New Issue