aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Aaron Gyes <me@aaron.gy>2016-06-12 00:56:25 -0700
committerGravatar Aaron Gyes <me@aaron.gy>2016-06-12 01:07:33 -0700
commit0ee03cbf988ae214be8061854a34d7212e2d2fab (patch)
tree8b4f9113a85c65211581aa171ac70a3ae17844c3
parent67339caa33e7dfcf29a5317695a7bbf5163e3dd2 (diff)
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.
-rw-r--r--src/fish_indent.cpp2
1 files changed, 1 insertions, 1 deletions
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) {