mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-20 03:35:41 +02:00
main: allow reading alternative config from pipe
This commit is contained in:
parent
bdc4fbe8e7
commit
8b1fa13686
2 changed files with 4 additions and 2 deletions
|
@ -23,6 +23,8 @@
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
* log-level: default to `warning`
|
* log-level: default to `warning`
|
||||||
|
* Read alternative config from pipes (e.g. `--config /dev/stdin`)
|
||||||
|
([#340][340]).
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
### Removed
|
### Removed
|
||||||
|
|
4
main.c
4
main.c
|
@ -223,8 +223,8 @@ main(int argc, char *const *argv)
|
||||||
if (stat(optarg, &st) == -1) {
|
if (stat(optarg, &st) == -1) {
|
||||||
fprintf(stderr, "%s: invalid configuration file: %s\n", optarg, strerror(errno));
|
fprintf(stderr, "%s: invalid configuration file: %s\n", optarg, strerror(errno));
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
} else if (!S_ISREG(st.st_mode)) {
|
} else if (!S_ISREG(st.st_mode) && !S_ISFIFO(st.st_mode)) {
|
||||||
fprintf(stderr, "%s: invalid configuration file: not a regular file\n",
|
fprintf(stderr, "%s: invalid configuration file: neither a regular file nor a pipe\n",
|
||||||
optarg);
|
optarg);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue