mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-03-22 12:40:41 +01:00
tools: libinput-record: return the correct exit value on invalid usage
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
1457ac8446
commit
5a275ef171
1 changed files with 4 additions and 2 deletions
|
|
@ -2345,7 +2345,7 @@ main(int argc, char **argv)
|
|||
const char *output_arg = NULL;
|
||||
bool multiple = false, all = false, with_libinput = false;
|
||||
int ndevices;
|
||||
int rc = 1;
|
||||
int rc = EXIT_FAILURE;
|
||||
|
||||
list_init(&ctx.devices);
|
||||
|
||||
|
|
@ -2361,12 +2361,13 @@ main(int argc, char **argv)
|
|||
case 'h':
|
||||
case OPT_HELP:
|
||||
usage();
|
||||
rc = 0;
|
||||
rc = EXIT_SUCCESS;
|
||||
goto out;
|
||||
case OPT_AUTORESTART:
|
||||
if (!safe_atoi(optarg, &ctx.timeout) ||
|
||||
ctx.timeout <= 0) {
|
||||
usage();
|
||||
rc = EXIT_INVALID_USAGE;
|
||||
goto out;
|
||||
}
|
||||
ctx.timeout = ctx.timeout * 1000;
|
||||
|
|
@ -2389,6 +2390,7 @@ main(int argc, char **argv)
|
|||
break;
|
||||
default:
|
||||
usage();
|
||||
rc = EXIT_INVALID_USAGE;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue