=================================================================== RCS file: /cvs/palm/Palm-Keyring/examples/example3.pl,v retrieving revision 1.6 retrieving revision 1.8 diff -u -r1.6 -r1.8 --- palm/Palm-Keyring/examples/example3.pl 2007/09/12 04:59:37 1.6 +++ palm/Palm-Keyring/examples/example3.pl 2008/02/27 23:54:02 1.8 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $RedRiver: example3.pl,v 1.5 2007/08/10 04:13:31 andrew Exp $ +# $RedRiver: example3.pl,v 1.7 2007/12/04 03:37:48 andrew Exp $ ######################################################################## # palmkeyring.pl *** a command line client for Keyring databases. # @@ -26,6 +26,7 @@ my $PDBFile; my $Categories; my $Names; +my $Accounts; my $Action_List; my $Action_Show; @@ -33,6 +34,7 @@ "file|f=s" => \$PDBFile, "categories|c:s@" => \$Categories, "name|n=s@" => \$Names, + "account|a=s@" => \$Accounts, "list|l" => \$Action_List, "show|s" => \$Action_Show, ); @@ -95,7 +97,6 @@ get_password() || die "Couldn't decrypt file!"; foreach (0..$#{ $pdb->{'records'} }) { - next if $_ == 0; my $r = $pdb->{'records'}->[$_]; my $category = @@ -111,6 +112,12 @@ next if ( @{ $Categories } || @{ $Names } ) && not $matched; my $a = $pdb->Decrypt($r); + $matched = 0; + + foreach my $account (@{ $Accounts }) { + $matched++ if uc($r->{plaintext}->{1}->{data}) eq uc($account); + } + next if ( @{ $Accounts } ) && not $matched; # XXX Fix up formatting print $a->{0}->{data} . "\n\t" .