summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-08-23 19:27:28 -0400
committerJesse Luehrs <doy@tozt.net>2013-08-23 19:27:52 -0400
commit5dce800ea2749a3ee0de34aaafe651dfbfdf8a4f (patch)
tree754e389df318e6bbaf03e253e86de7186089f531
parent0cc4c10382521ff68a1dca80d3a956f9c356ece4 (diff)
downloadconf-5dce800ea2749a3ee0de34aaafe651dfbfdf8a4f.tar.gz
conf-5dce800ea2749a3ee0de34aaafe651dfbfdf8a4f.zip
fixes for pass stuff
-rwxr-xr-xbin/pass33
-rw-r--r--urxvt/pass2
2 files changed, 18 insertions, 17 deletions
diff --git a/bin/pass b/bin/pass
index a99bde8..741b020 100755
--- a/bin/pass
+++ b/bin/pass
@@ -40,29 +40,30 @@ if ($cmd && $cmd eq 'search') {
die "Ambiguous pattern '$pat_str': could match any of @found\n";
}
else {
- if ($username) {
- if ($found[0] =~ m{^[^/]*/[^/]*/([^/]*)$}) {
- my $user = $1;
- if ($clipboard) {
- clip($user);
+ if (my $pass = `$PASS show '$found[0]'`) {
+ if ($username) {
+ if ($found[0] =~ m{^[^/]*/[^/]*/([^/]*)$}) {
+ my $user = $1;
+ if ($clipboard) {
+ clip($user);
+ }
+ else {
+ print "$user\n";
+ }
}
else {
- print "$user\n";
+ die "$found[0] has no username";
}
}
+
+ if ($clipboard) {
+ $pass =~ s/\n.*//s;
+ clip($pass);
+ }
else {
- die "$found[0] has no username";
+ print $pass;
}
}
-
- my $pass = `$PASS show $found[0]`;
- if ($clipboard) {
- $pass =~ s/\n.*//s;
- clip($pass);
- }
- else {
- print $pass;
- }
}
}
else {
diff --git a/urxvt/pass b/urxvt/pass
index d439ba2..bc80bcf 100644
--- a/urxvt/pass
+++ b/urxvt/pass
@@ -126,7 +126,7 @@ sub which_password {
$self->tt_write($password);
}
else {
- $self->msg("Unknown password $passname");
+ $self->timed_msg("Unknown password $passname");
}
$self->leave;
});