From 17dcbd295ee1fde4ae56234fe0a3171a7561b088 Mon Sep 17 00:00:00 2001 From: silverweed <silverweed14@proton.me> Date: Tue, 12 Nov 2024 13:31:10 +0100 Subject: [PATCH] allow -n in nogfx mode --- src/rntviewer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rntviewer.cpp b/src/rntviewer.cpp index 50e8d35..eff9b97 100644 --- a/src/rntviewer.cpp +++ b/src/rntviewer.cpp @@ -133,9 +133,10 @@ int main(int argc, char **argv) return 1; } + b8 is_interactive = !args.print_to_terminal && !args.only_print_rntuple_names; #ifdef RNT_NO_GFX - if (!args.print_to_terminal) { - fprintf(stderr, "rntviewer was compiled without graphics support. Please use -t to enable terminal mode.\n"); + if (is_interactive) { + fprintf(stderr, "rntviewer was compiled without graphics support. Please use -t or -n to run in terminal mode.\n"); return 0; } #endif @@ -151,7 +152,7 @@ int main(int argc, char **argv) // Watch file for changes (to adapt the displayed file size - otherwise // we may try to access invalid memory when the file gets shrunk) - if (!args.print_to_terminal) + if (is_interactive) os_start_file_watch(args.file_name, app); }