simplify listing and fix bug with category names.
This commit is contained in:
parent
8616243660
commit
ca8f29c15e
15
pash
15
pash
|
@ -37,7 +37,14 @@ pw_show() {
|
|||
pw_list() {
|
||||
shopt -s globstar nullglob
|
||||
|
||||
[[ $tree ]] &&
|
||||
if [[ $tree ]]; then
|
||||
tree
|
||||
else
|
||||
printf '%s\e[4D\e[K\n' **/*.gpg
|
||||
fi
|
||||
}
|
||||
|
||||
tree() {
|
||||
printf '%s\n' "pash"
|
||||
|
||||
for pwrd in **; do
|
||||
|
@ -48,16 +55,10 @@ pw_list() {
|
|||
pwrd=${pwrd//[^[:print:]]/^[}
|
||||
pwrd=${pwrd//.gpg}
|
||||
|
||||
if [[ -z $tree ]]; then
|
||||
printf '%s\n' "$pwrd"
|
||||
|
||||
else
|
||||
printf '%s\n' "${nest//\//│ }├─ ${pwrd##*/}${dir}"
|
||||
dir=
|
||||
fi
|
||||
done
|
||||
|
||||
[[ $tree ]] &&
|
||||
printf '└%s\b┘\n' "${nest//\//──┴}"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue