summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2020-05-04 00:06:41 -0400
committerJesse Luehrs <doy@tozt.net>2020-05-04 00:06:41 -0400
commiteb82836e5f2972c7a9bf8982af987b645140fc40 (patch)
tree28b2f621a44e0348650307780484e3f22cc28b00
parent1f8c162426ef022cb1a884851b3fa64ff807d8a0 (diff)
downloadconf-eb82836e5f2972c7a9bf8982af987b645140fc40.tar.gz
conf-eb82836e5f2972c7a9bf8982af987b645140fc40.zip
include folders when picking passwords
-rwxr-xr-xbin/hush/p4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/hush/p b/bin/hush/p
index 79c57c3..dc0ba9c 100755
--- a/bin/hush/p
+++ b/bin/hush/p
@@ -1,5 +1,5 @@
-#!/bin/sh
+#!/bin/bash
set -eu
set -o pipefail
-rbw ls --fields name,user | perl -pale'$_ = "$F[0]/$F[1]\t$_"' | fzf --with-nth=1 | perl -pale's/^[^\t]*\t//' | xargs -r rbw get
+rbw ls --fields name,user,folder | perl -plE'/^([^\t]*)\t([^\t]*)\t([^\t]*)$/; $_ = join("/", grep { length } ($3, $1, $2)) . "\t$_"' | sort | fzf --with-nth=1 | perl -ple'/^([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)$/; $_ = "$2 $3"' | xargs -r rbw get