diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-05-13 12:32:28 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-05-13 12:32:28 +0200 |
commit | 4149a04c9857873553b2b39feaa84181c2320813 (patch) | |
tree | df6402aeff4ffdad147bc06eacf61aa648857063 /lib/App/Raps2.pm | |
parent | a3085b24320ac3d9eaa56b71b8dce1a58a4a7e06 (diff) |
Add raps2 list
Diffstat (limited to 'lib/App/Raps2.pm')
-rw-r--r-- | lib/App/Raps2.pm | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/App/Raps2.pm b/lib/App/Raps2.pm index f05f21e..6b4929c 100644 --- a/lib/App/Raps2.pm +++ b/lib/App/Raps2.pm @@ -40,7 +40,7 @@ use App::Raps2::UI; use Carp q(confess); use File::BaseDir qw(config_home data_home); use File::Path qw(make_path); -use File::Slurp qw(slurp write_file); +use File::Slurp qw(read_dir slurp write_file); our @EXPORT_OK = (); our $VERSION = '0.1'; @@ -327,3 +327,22 @@ sub cmd_info { ['Login', $key{'login'}], ); } + +=head2 ->cmd_list() + +Lists all saved passwords and their logins and urls + +=cut + +sub cmd_list { + my ($self) = @_; + + for my $file (read_dir($self->{xdg_data})) { + my %key = file_to_hash($self->{xdg_data} . "/${file}"); + $self->ui->list( + ['Account', $file], + ['Login', $key{login}], + ['URL', $key{url}], + ); + } +} |