From 325a2eb8e2c520d312eb2d064fa000c0c1354e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20=C3=96hrstr=C3=B6m?= Date: Wed, 16 Aug 2023 16:44:48 +0200 Subject: [PATCH] Only print help if no arguments given and stdin is a tty. --- rtl_wmbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtl_wmbus.c b/rtl_wmbus.c index a8208a3..f026700 100644 --- a/rtl_wmbus.c +++ b/rtl_wmbus.c @@ -1175,7 +1175,7 @@ int main(int argc, char *argv[]) #if WINDOWS_BUILD == 1 _setmode(_fileno(stdin), _O_BINARY); #else - if (isatty(0)) + if (isatty(0) && argc == 1) { // Standard input is a terminal, print help. print_usage(argv[0]);