diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-08-23 19:27:28 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-08-23 19:27:52 -0400 |
commit | 5dce800ea2749a3ee0de34aaafe651dfbfdf8a4f (patch) | |
tree | 754e389df318e6bbaf03e253e86de7186089f531 /bin | |
parent | 0cc4c10382521ff68a1dca80d3a956f9c356ece4 (diff) | |
download | conf-5dce800ea2749a3ee0de34aaafe651dfbfdf8a4f.tar.gz conf-5dce800ea2749a3ee0de34aaafe651dfbfdf8a4f.zip |
fixes for pass stuff
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/pass | 33 |
1 files changed, 17 insertions, 16 deletions
@@ -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 { |