tools: when the command isn't installed, print that

Makes it more user-friendly to be able to split the tools into multiple
packages

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2017-11-09 15:17:37 +10:00
parent be344a3afb
commit 92aa1d1418

View file

@ -510,11 +510,20 @@ tools_exec_command(const char *prefix, int real_argc, char **real_argv)
setup_path();
rc = execvp(executable, argv);
if (rc)
fprintf(stderr,
"Failed to execute '%s' (%s)\n",
command,
strerror(errno));
if (rc) {
if (errno == ENOENT) {
fprintf(stderr,
"libinput: %s is not a libinput command or not installed. "
"See 'libinput --help'\n",
command);
} else {
fprintf(stderr,
"Failed to execute '%s' (%s)\n",
command,
strerror(errno));
}
}
return EXIT_FAILURE;
}