Skip to content

Commit

Permalink
print info msg to stderr to avoid the data being sent to pipes
Browse files Browse the repository at this point in the history
  • Loading branch information
trapd00r committed May 14, 2022
1 parent b21619e commit fc2c8f9
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions bin/beet2mpd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# {add} No such directory at /home/scp1/lib/perl5/Audio/MPD.pm line 156
# '--> error handling below

our $VERSION = '0.24';
our $VERSION = '0.26';

use strict;
use warnings FATAL => 'all';
Expand Down Expand Up @@ -78,13 +78,15 @@ if(scalar(@tracks) == 0) {
exit;
}

#if($opt->{verbose}) {
printf("> %s%s songs matching query '%s'\n",
$opt->{add} ? 'Adding ' : '',
fg(208, bold(scalar @tracks)),
fg(137, bold(italic(join(' ', @{ $opt->{query} }))))
);
#}
# print info msg to stderr so that pipe operations don't include this data
select STDERR;
printf("> %s%s songs matching query '%s'\n",
$opt->{add} ? 'Adding ' : '',
scalar @tracks,
join(' ', @{ $opt->{query} })
);

select STDOUT;

for my $track(@tracks) {
if($opt->{add}) {
Expand Down

0 comments on commit fc2c8f9

Please sign in to comment.