digint / btrbk

Tool for creating snapshots and remote backups of btrfs subvolumes
https://digint.ch/btrbk/
GNU General Public License v3.0
1.64k stars 120 forks source link

Version printed via stderr #452

Closed chrenderle closed 2 years ago

chrenderle commented 2 years ago

I wanted to pipe the version message to grep to extract the version number. In the process I found out, that the version message is printed to stderr instead of stdout. Is there a particular reason why the version number is printed to stderr? In my opinion it doesn't make sense because it is not an error.

sub VERSION_MESSAGE
{
  print STDERR $VERSION_INFO . "\n\n";
}

Because of this one needs to use btrbk --version 2>&1 | grep <expression> instead of btrbk --version | grep <expression>

digint commented 2 years ago

Thanks for reporting. This is wrong, version and help should be printed to stdout if explicitely asked for (but should still go to stderr on errors).

fixed in: 4fcbbad802093ac23220fd6eff56db85297878b4

digint commented 2 years ago

included in btrbk-0.32.2