From 0ee03cbf988ae214be8061854a34d7212e2d2fab Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Sun, 12 Jun 2016 00:56:25 -0700 Subject: 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. --- src/fish_indent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fish_indent.cpp b/src/fish_indent.cpp index 67201975..9436944a 100644 --- a/src/fish_indent.cpp +++ b/src/fish_indent.cpp @@ -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) { -- cgit v1.2.3