From 5f3ac17a401f9c6b99f9df2a4fc078c37764d02a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 21 Jul 2011 17:07:40 +0200 Subject: Add -C/--chrome option (shortcut for -x 'xclip -l 2') --- bin/raps2 | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'bin/raps2') diff --git a/bin/raps2 b/bin/raps2 index 0bd8f52..80cafee 100755 --- a/bin/raps2 +++ b/bin/raps2 @@ -11,12 +11,13 @@ use File::BaseDir qw(data_files data_home); use File::Slurp qw(read_dir); use Getopt::Long qw(:config no_ignore_case); -my ( $default_cost, $no_echo, $paste, $pwgen_cmd, $xclip_cmd ); +my ( $chrome, $default_cost, $no_echo, $paste, $pwgen_cmd, $xclip_cmd ); our $VERSION = '0.52'; GetOptions( 'c|cost=i' => \$default_cost, + 'C|chrome' => \$chrome, 'E|no-echo' => \$no_echo, 'h|help' => sub { cmd_help(0) }, 'p|pwgen-cmd=s' => \$pwgen_cmd, @@ -26,6 +27,10 @@ GetOptions( ) or cmd_help(1); +if ($chrome) { + $xclip_cmd = 'xclip -l 2'; +} + my ( $action, @args ) = @ARGV; my $raps2 = App::Raps2->new( cost => $default_cost, @@ -326,7 +331,7 @@ Decrypt I's password and store it in the primary X Clipboard. Note that it can only be pasted once. Prints the content of the multiline B field (if present) to stdout. -See also the B<-x> option. +See also the B<-C> and B<-x> options. =item B I @@ -357,6 +362,16 @@ Crypt::Eksblowfish(3pm). Default: 12 +=item B<-C>, B<--chrome> + +Google Chrome support. Normally, B makes sure the password can +only be pasted once, but Google Chrome (for whatever reason) needs to paste it +twice. Do not use this option if you are not going to paste the password into +a Chrome window. + +Basically, this is a shortcut for C<< raps2 -x 'xclip -l 2' >>. This +overrides B<-x>. + =item B<-E>, B<--no-echo> When using the pwgen functionality of B, do not print the generated @@ -367,7 +382,7 @@ password on stdout. When using the pwgen functionality of B, do not print the generated password on stdout. Place it in the X Clipboard instead. -Note that it can only be pasted once. +Note that it can only be pasted once, unless B<-x> or B<-C> is used. =item B<-p>, B<--pwgen-cmd> I @@ -384,8 +399,8 @@ Show version information. =item B<-x>, B<--xclip-cmd> I -Command to run for B. Set this to C<< xclip -l 2 >> if you are -using chrome. The password will be available on I's stdin. +Command to run for B. The password will be available on +I's stdin. Default: xclip -l 1 -- cgit v1.2.3