summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-07-20 22:57:01 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-07-20 22:57:01 +0200
commit7e948f4248953e135ba9824e15801b313f69c9da (patch)
treeecfd531eabb4b9221ad945e5eaa37e516981f087
parent11492c5d7ece59a11b80db5f882fc3f5dabc7e87 (diff)
Fix pwgen usage, release v0.520.52
-rw-r--r--Changelog4
-rwxr-xr-xbin/raps26
-rw-r--r--lib/App/Raps2.pm8
-rw-r--r--lib/App/Raps2/Password.pm4
-rw-r--r--lib/App/Raps2/UI.pm4
5 files changed, 16 insertions, 10 deletions
diff --git a/Changelog b/Changelog
index a71b51f..f9498df 100644
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,7 @@
+App::Raps2 0.52 - Wed Jul 20 2011
+
+ * raps2 add: Fix pwgen usage (remove trailing whitespace)
+
App::Raps2 0.51 - Wed Jul 20 2011
* Major usability improvements
diff --git a/bin/raps2 b/bin/raps2
index 2246f86..5aed4c9 100755
--- a/bin/raps2
+++ b/bin/raps2
@@ -13,7 +13,7 @@ use Getopt::Long qw(:config no_ignore_case);
my ( $default_cost, $no_echo, $paste, $pwgen_cmd );
-our $VERSION = '0.51';
+our $VERSION = '0.52';
GetOptions(
'c|cost=i' => \$default_cost,
@@ -275,7 +275,7 @@ B<raps2> [I<options>] I<action> [I<args ...>]
=head1 VERSION
-This manual documents B<raps2> version 0.51
+This manual documents B<raps2> version 0.52
=head1 DESCRIPTION
@@ -369,6 +369,8 @@ Note that it can only be pasted once.
When the user does not enter a password in B<raps2 add>, it will execute
I<command> to create one. The first line of output is taken as password.
+If the output contains spaces, anything after the first space (plus the space
+itself) is discarded.
Default: pwgen -s 23 1
diff --git a/lib/App/Raps2.pm b/lib/App/Raps2.pm
index 1d18d79..d13aaed 100644
--- a/lib/App/Raps2.pm
+++ b/lib/App/Raps2.pm
@@ -12,7 +12,7 @@ use File::BaseDir qw(config_home data_home);
use File::Path qw(make_path);
use File::Slurp qw(slurp write_file);
-our $VERSION = '0.51';
+our $VERSION = '0.52';
sub new {
my ( $class, %opt ) = @_;
@@ -186,7 +186,7 @@ sub generate_password {
my ($self) = @_;
open( my $pwgen, q{-|}, $self->conf('pwgen_cmd') ) or return;
- my $password = <$pwgen>;
+ my $password = ( split( / /, <$pwgen> ) )[0];
close($pwgen) or cluck("Cannot close pwgen pipe: $!");
chomp $password;
@@ -299,7 +299,7 @@ B<App::Raps2> is the backend for B<raps2>, a simple commandline password safe.
=head1 VERSION
-This manual documents App::Raps2 version 0.51
+This manual documents App::Raps2 version 0.52
=head1 METHODS
@@ -394,7 +394,7 @@ from the defaults config file.
=item $raps2->generate_password()
Runs B<pwgen_cmd> (as specified in B<new> or the config file) and returns its
-first line of output, without the trailing newline.
+first word of output, without trailing newlines / whitespaces.
=back
diff --git a/lib/App/Raps2/Password.pm b/lib/App/Raps2/Password.pm
index 6b5be02..9eeb875 100644
--- a/lib/App/Raps2/Password.pm
+++ b/lib/App/Raps2/Password.pm
@@ -9,7 +9,7 @@ use Crypt::CBC;
use Crypt::Eksblowfish;
use Crypt::Eksblowfish::Bcrypt qw(bcrypt_hash en_base64 de_base64);
-our $VERSION = '0.51';
+our $VERSION = '0.52';
sub new {
my ( $obj, %conf ) = @_;
@@ -135,7 +135,7 @@ App::Raps2::Password - Password class for App::Raps2
=head1 VERSION
-This manual documents B<App::Raps2::Password> version 0.51
+This manual documents B<App::Raps2::Password> version 0.52
=head1 DESCRIPTION
diff --git a/lib/App/Raps2/UI.pm b/lib/App/Raps2/UI.pm
index c8b34c0..4914b71 100644
--- a/lib/App/Raps2/UI.pm
+++ b/lib/App/Raps2/UI.pm
@@ -8,7 +8,7 @@ use Carp qw(cluck confess);
use POSIX;
use Term::ReadLine;
-our $VERSION = '0.51';
+our $VERSION = '0.52';
sub new {
my ($obj) = @_;
@@ -132,7 +132,7 @@ App::Raps2::UI - App::Raps2 User Interface
=head1 VERSION
-This manual documents B<App::Raps2::UI> version 0.51
+This manual documents B<App::Raps2::UI> version 0.52
=head1 DESCRIPTION