From f02104ecdafa7d8fc8320b94f315776a1cc7e162 Mon Sep 17 00:00:00 2001
From: Daniel Lundin <dln@eintr.org>
Date: Mon, 26 Feb 2018 12:56:34 +0100
Subject: [PATCH] Fix error case when not logged in

---
 bin/lp-ssh-add | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/lp-ssh-add b/bin/lp-ssh-add
index 484cd02..ffe29cf 100755
--- a/bin/lp-ssh-add
+++ b/bin/lp-ssh-add
@@ -6,8 +6,8 @@ if [[ "$SSH_ASKPASS" == $0 ]]; then
 fi
 
 if [[ -z "$1" ]]; then
-  lpass ls --color=never ssh | cut -d ' ' -f1 | fzf | xargs -n1 $0
-  exit 0
+  _key=$(lpass ls --color=never ssh | cut -d ' ' -f1 | fzf -1 -0)
+  exec $0 $_key
 fi
 
 _tmp=$(mktemp -d)