Make script file error a bit more obvious

This didn't even mention that it was a script file, it was just

filename: File not found

Which would be rather confusing if e.g. someone forgot that
`--profile` requires an argument.
This commit is contained in:
Fabian Homborg 2021-11-20 17:40:47 +01:00
parent 707f042fc4
commit 91ce41a2b4

View file

@ -563,7 +563,8 @@ int main(int argc, char **argv) {
const char *file = *(argv + (my_optind++));
autoclose_fd_t fd(open_cloexec(file, O_RDONLY));
if (!fd.valid()) {
perror(file);
FLOGF(error, _(L"Error reading script file '%s':"), file);
perror("error");
} else {
wcstring_list_t list;
for (char **ptr = argv + my_optind; *ptr; ptr++) {