mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-15 17:28:19 +00:00
Error on -w without a path before reading stdin
Oops, `fish_indent -w` just sits there waiting for input if nothing is pointing at it, only to give user the error afterwards.
This commit is contained in:
parent
67339caa33
commit
0ee03cbf98
1 changed files with 1 additions and 1 deletions
|
@ -409,11 +409,11 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
wcstring src;
|
||||
if (argc == 0) {
|
||||
src = read_file(stdin);
|
||||
if (output_type == output_type_file) {
|
||||
fwprintf(stderr, _(L"You cannot use -w without providing the path to read from and write to."));
|
||||
exit(1);
|
||||
}
|
||||
src = read_file(stdin);
|
||||
} else if (argc == 1) {
|
||||
FILE *fh = fopen(*argv, "r");
|
||||
if (fh) {
|
||||
|
|
Loading…
Reference in a new issue