diff options
author | Daniel Friesel <derf@finalrewind.org> | 2014-10-31 13:39:58 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2014-10-31 13:39:58 +0100 |
commit | a337b9b6ec90a4befb4ed0c82ccf5f6602261efe (patch) | |
tree | 5c0c7d13232bb73bde8cf44074090ef9e1dc6396 /bin/raps2 | |
parent | 33dd947649338ac561afac3f457e9b77dc3de57c (diff) |
add primitive raps2 dump-all command
Diffstat (limited to 'bin/raps2')
-rwxr-xr-x | bin/raps2 | 39 |
1 files changed, 32 insertions, 7 deletions
@@ -135,6 +135,30 @@ sub cmd_dump { return; } +sub cmd_dump_all { + my @files = read_dir( data_home('raps2') ); + + $raps2->get_master_password(); + + for my $file (@files) { + my $key = $raps2->pw_load( file => data_files("raps2/${file}") ); + + $raps2->ui->output( + [ 'Key', $file ], + [ 'URL', $key->{url} ], + [ 'Login', $key->{login} ], + [ 'Password', $key->{password} ], + ); + if ( $key->{extra} ) { + print $key->{extra}; + } + + print "\n"; + } + + return; +} + sub cmd_edit { my ($name) = @_; @@ -261,13 +285,14 @@ sub cmd_remove { } given ($action) { - when ('add') { cmd_add(@args) } - when ('del') { cmd_remove(@args) } - when ('dump') { cmd_dump(@args) } - when ('edit') { cmd_edit(@args) } - when ('get') { cmd_get(@args) } - when ('info') { cmd_info(@args) } - when ('list') { cmd_list(@args) } + when ('add') { cmd_add(@args) } + when ('del') { cmd_remove(@args) } + when ('dump') { cmd_dump(@args) } + when ('dump-all') { cmd_dump_all(@args) } + when ('edit') { cmd_edit(@args) } + when ('get') { cmd_get(@args) } + when ('info') { cmd_info(@args) } + when ('list') { cmd_list(@args) } default { cmd_help(1) } } |