=================================================================== RCS file: /cvs/palm/Palm-Keyring/examples/example3.pl,v retrieving revision 1.7 retrieving revision 1.10 diff -u -r1.7 -r1.10 --- palm/Palm-Keyring/examples/example3.pl 2007/12/04 03:37:48 1.7 +++ palm/Palm-Keyring/examples/example3.pl 2008/03/05 22:04:46 1.10 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $RedRiver: example3.pl,v 1.6 2007/09/12 03:59:37 andrew Exp $ +# $RedRiver: example3.pl,v 1.9 2008/02/28 00:17:33 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, ); @@ -93,10 +95,8 @@ sub show_items { get_password() || die "Couldn't decrypt file!"; - foreach (0..$#{ $pdb->{'records'} }) { - my $r = $pdb->{'records'}->[$_]; - + my $r = $pdb->{'records'}->[$_]; my $category = $pdb->{'appinfo'}->{'categories'}->[ $r->{'category'} ]->{'name'}; @@ -109,7 +109,13 @@ } next if ( @{ $Categories } || @{ $Names } ) && not $matched; - my $a = $pdb->Decrypt($r); + my $a = $pdb->Decrypt($r); + + $matched = 0; + foreach my $account (@{ $Accounts }) { + $matched++ if uc($a->{1}->{data}) eq uc($account); + } + next if ( @{ $Accounts } ) && not $matched; # XXX Fix up formatting print $a->{0}->{data} . "\n\t" .