summaryrefslogtreecommitdiffstats
path: root/rbw/.bin/p
diff options
context:
space:
mode:
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