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:
Aaron Gyes 2016-06-12 00:56:25 -07:00
parent 67339caa33
commit 0ee03cbf98

View file

@ -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) {