diff options
| -rw-r--r-- | Changelog | 1 | ||||
| -rw-r--r-- | lib/App/Raps2.pm | 14 | 
2 files changed, 10 insertions, 5 deletions
@@ -6,6 +6,7 @@ git HEAD      * Rename pw_get to pw_load      * pw_load now also returns the salt      * file_to_hash now returns a hashref instead of a hash +    * Allow password to be passed as argument to get_master_password  App::Raps2 0.4 - Sun Jul 03 2011 diff --git a/lib/App/Raps2.pm b/lib/App/Raps2.pm index faf74d9..720e942 100644 --- a/lib/App/Raps2.pm +++ b/lib/App/Raps2.pm @@ -63,8 +63,11 @@ sub sanity_check {  }  sub get_master_password { -	my ($self) = @_; -	my $pass = $self->ui->read_pw( 'Master Password', 0 ); +	my ( $self, $pass ) = @_; + +	if ( not defined $pass ) { +		$pass = $self->ui->read_pw( 'Master Password', 0 ); +	}  	$self->{pass} = App::Raps2::Password->new(  		cost       => $self->{default}->{cost}, @@ -219,16 +222,17 @@ B<cost> of key setup, passed on to App::Raps2::Password(3pm).  Reads $file (lines with key/value separated by whitespace) and returns a  hashref with its key/value pairs. -=item $raps2->get_master_password() +=item $raps2->get_master_password([I<$password>]) -Asks the user for the master passphrase. +Sets the master password used to encrypt all accounts. Uses I<password> if +specified, otherwise it asks the user via App::Raps2::UI(3pm).  =item $raps2->pw_save(I<%data>)  Write an account as specified by I<data> to the store. Requires  B<get_master_password> to have been called before. -The following I<data> keys are possible: +The following I<data> keys are supported:  =over  | 
