/* Now process all the files given at the command line. */
bool only_one = remaining + 1 == argc;
+ bool one_passed = false;
do
{
try
if (!only_one)
std::cout << std::endl << fname << ":" << std::endl;
dwarflint lint (fname, check_option.rules);
+ one_passed = true;
if (prev_error_count == error_count && !be_quiet)
puts (gettext ("No errors"));
}
while (++remaining < argc);
- for (checkrules::const_iterator it = check_option.rules.begin ();
- it != check_option.rules.end (); ++it)
- if (!it->used ())
- std::cerr << "warning: the rule `" << it->name ()
- << "' never matched." << std::endl;
+ if (one_passed)
+ for (checkrules::const_iterator it = check_option.rules.begin ();
+ it != check_option.rules.end (); ++it)
+ if (!it->used ())
+ std::cerr << "warning: the rule `" << it->name ()
+ << "' never matched." << std::endl;
return error_count != 0;
}
testrun_compare ./dwarflint --check=oentuh -q nodebug <<EOF
warning: the rule \`oentuh' never matched.
EOF
+
+# ... and since we are testing this here, also check that we don't get
+# this message in situations where it makes no sense.
+LANG=C testrun_compare ./dwarflint --check=oentuh -q noeuht <<EOF
+error: Cannot open input file: No such file or directory.
+EOF
+
+LANG=C testrun_compare ./dwarflint --check=oentuh -q noeuht nodebug <<EOF
+
+noeuht:
+error: Cannot open input file: No such file or directory.
+
+nodebug:
+warning: the rule \`oentuh' never matched.
+EOF
+
+LANG=C testrun_compare ./dwarflint --check=oentuh -q nodebug nodebug <<EOF
+
+nodebug:
+
+nodebug:
+warning: the rule \`oentuh' never matched.
+EOF