From 40a922893d15742105e3e0ca1460d268a943e5af Mon Sep 17 00:00:00 2001 From: Mario Fink Date: Fri, 12 Feb 2021 09:29:55 +0100 Subject: [PATCH] CLI: fix options vs. argc handling --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 660ff1a..5c603f9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -146,7 +146,7 @@ int main(int argc, char* argv[]) else { // check for at least one file argument - if ( argc == 1 ) + if ( cfgopts.size() == (unsigned int)argc-1 ) { std::cerr<<"no .raw file given => check --help for usage\n"; return 1; @@ -154,7 +154,7 @@ int main(int argc, char* argv[]) std::string rawfile(argv[1]); // one further argument to do something useful with the file - if ( argc == 2 ) + if ( cfgopts.size() == 0 ) { std::cerr<<"provide any option => check --help for usage\n"; return 1;