program only tag requested on command-line
[Biblio-RFID.git] / scripts / program.pl
index b0fc125..565bb2a 100755 (executable)
@@ -29,6 +29,10 @@ GetOptions(
 ) || die $!;
 
 my ( $sid, $content ) =  @ARGV;
+if ( $sid =~ m/.+,.+/ && ! defined $content ) {
+       ( $sid, $content ) = split(/,/, $sid);
+}
+
 die "usage: $0 [--reader regex_filter] [--afi 214] [--type 1] E0_RFID_SID [barcode]\n" unless $sid && ( $content || $afi || $blank );
 
 $hash->{content} = $content if defined $content;
@@ -38,7 +42,7 @@ $Biblio::RFID::debug = $debug;
 
 foreach my $tag ( $rfid->tags, $sid ) {
        warn "visible $tag\n";
-#      next unless $tag eq $sid;
+       next unless $tag eq $sid;
        if ( grep { defined $_ } values %$blank ) {
                my $type = ( grep { $blank->{$_} } keys %$blank )[0];
                warn "BLANK $type $tag\n";