CLI: fix options vs. argc handling

This commit is contained in:
Mario Fink 2021-02-12 09:29:55 +01:00
parent 78c1ec4596
commit 40a922893d

View File

@ -146,7 +146,7 @@ int main(int argc, char* argv[])
else else
{ {
// check for at least one file argument // 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"; std::cerr<<"no .raw file given => check --help for usage\n";
return 1; return 1;
@ -154,7 +154,7 @@ int main(int argc, char* argv[])
std::string rawfile(argv[1]); std::string rawfile(argv[1]);
// one further argument to do something useful with the file // 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"; std::cerr<<"provide any option => check --help for usage\n";
return 1; return 1;