From f6949458b793edf4b68ee0384174bfa949b1cc2d Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Tue, 23 May 2017 15:48:26 +0200 Subject: [PATCH] tools: make led a first class citizen of ratbag-command Allows to follow the usage message: we do not need to provide the currently active profile. Signed-off-by: Benjamin Tissoires --- tools/ratbag-command.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/ratbag-command.c b/tools/ratbag-command.c index bbe71be5..2ce103b5 100644 --- a/tools/ratbag-command.c +++ b/tools/ratbag-command.c @@ -273,7 +273,7 @@ fill_options(struct ratbag *ratbag, struct ratbag_button *button = options->button; int rc; - if ((flags & (FLAG_NEED_DEVICE|FLAG_NEED_PROFILE|FLAG_NEED_RESOLUTION)) && + if ((flags & (FLAG_NEED_DEVICE|FLAG_NEED_PROFILE|FLAG_NEED_RESOLUTION|FLAG_NEED_LED)) && device == NULL) { rc = ratbag_cmd_device_from_arg(ratbag, argc, argv, &device); @@ -282,7 +282,7 @@ fill_options(struct ratbag *ratbag, options->device = device; } - if ((flags & (FLAG_NEED_PROFILE|FLAG_NEED_RESOLUTION)) && + if ((flags & (FLAG_NEED_PROFILE|FLAG_NEED_RESOLUTION|FLAG_NEED_LED)) && profile == NULL) { profile = ratbag_cmd_get_active_profile(device); if (!profile) @@ -2019,6 +2019,7 @@ static const struct ratbag_cmd top_level_commands = { &cmd_profile, &cmd_resolution_dpi, &cmd_resolution_rate, + &cmd_led, NULL, }, };