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