sahib / rmlint

Extremely fast tool to remove duplicates and other lint from your filesystem
http://rmlint.rtfd.org
GNU General Public License v3.0
1.91k stars 132 forks source link

Fix verbosity logic and documentation #500

Closed cebtenzzre closed 3 years ago

cebtenzzre commented 3 years ago

Only five verbosity levels really exist (-VV through -vv), and -VV couldn't even be reached before - but that was masked by the first two (G_LOG_LEVEL_ERROR and G_LOG_LEVEL_CRITICAL) being the wrong way around.

This will only break scripts if they relied on -V silencing errors logged to stderr, but if scripts were silencing stderr they were most likely ignoring it, and this was an undocumented "feature" (the docs recommended -VVV), so IMO it's not a concern.

Example 1

$ rmlint --is-reflink nothing nothing

Output before and after these changes:

ERROR: lib/utilities.c:1335: rm_util_link_type: Error opening nothing: No such file or directory
An error occurred during checking

Example 2

$ rmlint --is-reflink -V nothing nothing

Output before these changes: (no output) The warning and the error have been disabled, because G_LOG_LEVEL_ERROR >= G_LOG_LEVEL_CRITICAL is false. This is the lowest verbosity level; -VV and -VVV are clamped to -V.

Output after these changes:

ERROR: lib/utilities.c:1335: rm_util_link_type: Error opening nothing: No such file or directory

The warning has been disabled.

Example 3

$ rmlint --is-reflink -VV nothing nothing

Output before and after these changes: (no output) The warning and the error have been disabled. This worked before by coincidence, as it was effectively -V but -V silenced errors too.