summaryrefslogtreecommitdiffstats
path: root/rbw/.bin/p
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2024-02-27 22:29:09 -0500
committerJesse Luehrs <doy@tozt.net>2024-02-27 22:29:09 -0500
commitd5e72ac1b3d1aacec097c1d41decbe748c035f06 (patch)
treee75f879e5cdf3b51eb23ab321eb6e8ec2ce6ea9a /rbw/.bin/p
parent0179eebc614a5668048b510cb7a0776354c16dc3 (diff)
downloadconf-d5e72ac1b3d1aacec097c1d41decbe748c035f06.tar.gz
conf-d5e72ac1b3d1aacec097c1d41decbe748c035f06.zip
rearrange some more things
Diffstat (limited to 'rbw/.bin/p')
-rwxr-xr-xrbw/.bin/p5
1 files changed, 5 insertions, 0 deletions
diff --git a/rbw/.bin/p b/rbw/.bin/p
new file mode 100755
index 0000000..cbf15c4
--- /dev/null
+++ b/rbw/.bin/p
@@ -0,0 +1,5 @@
+#!/bin/bash
+set -eu
+set -o pipefail
+
+rbw ls --fields name,user,folder | perl -plE'/^([^\t]*)\t([^\t]*)\t([^\t]*)$/; $_ = join("/", grep { length } ($3, $1, $2)) . "\0$_"' | sort | fzf --with-nth=1 -d '\x00' | perl -ple'/^([^\0]*)\0([^\t]*)\t([^\t]*)\t([^\t]*)$/; $_ = "$2 $3"; $_ .= " --folder=\"$4\"" if length $4' | xargs -r rbw get