aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/fish_indent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fish_indent.cpp')
-rw-r--r--src/fish_indent.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/fish_indent.cpp b/src/fish_indent.cpp
index cab9df03..67201975 100644
--- a/src/fish_indent.cpp
+++ b/src/fish_indent.cpp
@@ -348,7 +348,7 @@ int main(int argc, char *argv[]) {
output_type_ansi,
output_type_html
} output_type = output_type_plain_text;
- const char *output_location;
+ const char *output_location = "";
bool do_indent = true;
const char *short_opts = "+dhvwi";
@@ -410,6 +410,10 @@ 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);
+ }
} else if (argc == 1) {
FILE *fh = fopen(*argv, "r");
if (fh) {