View Issue Details

IDProjectCategoryView StatusLast Update
0000162fileGeneralpublic2020-06-07 17:41
Reportervinc17 Assigned Tochristos  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.38 
Fixed in Version5.39 
Summary0000162: should allow one to provided a non-existing -e / --exclude test
DescriptionCurrently, if one provides a non-existing -e / --exclude test, one gets a fatal error. This is a portability issue, for instance if one wishes to exclude some new test that has been added in some version of "file", but one uses various machines, having different versions of "file". With recent versions of "file", the test would be excluded. And with older versions, the test does not exist yet, so that excluding it should not change anything (instead of triggering an error like now).

Example: the json test was added quite recently, and this was an issue, at least last year: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=923396

Solution 1: Just ignore non-existing tests, because they can be future tests not available yet. So this is safe.

Solution 2: Output a warning to stderr (e.g. to warn the user in case he would have mistyped the test name), and add away to disable the warnings (useful for scripts). Redirecting stderr to /dev/null would not be a solution as this would hide error messages too, which are useful to diagnostic problems. This could be implemented as an option in addition to -e / --exclude, such as -q / --quiet. This could also be an option in place of -e / --exclude, such as --exclude-quiet (I would say that this is mainly for scripts, so that a short option is not necessary).
TagsNo tags attached.

Activities

christos

2020-06-07 17:41

manager   ~0003422

Added --exclude-quiet

Issue History

Date Modified Username Field Change
2020-05-17 12:54 vinc17 New Issue
2020-06-07 17:41 christos Assigned To => christos
2020-06-07 17:41 christos Status new => assigned
2020-06-07 17:41 christos Status assigned => resolved
2020-06-07 17:41 christos Resolution open => fixed
2020-06-07 17:41 christos Fixed in Version => 5.39
2020-06-07 17:41 christos Note Added: 0003422