pash: better listing
This commit is contained in:
parent
86d72380ba
commit
3065aa621a
13
pash
13
pash
|
@ -84,15 +84,14 @@ pw_copy() {
|
||||||
}
|
}
|
||||||
|
|
||||||
pw_list() {
|
pw_list() {
|
||||||
set +f
|
find . -type f -name \*.gpg | sed 's/..//;s/\.gpg$//'
|
||||||
find -- * -type f -name \*.gpg
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pw_tree() {
|
pw_tree() {
|
||||||
command -v tree >/dev/null 2>&1 ||
|
command -v tree >/dev/null 2>&1 ||
|
||||||
die "'tree' command not found"
|
die "'tree' command not found"
|
||||||
|
|
||||||
tree --noreport
|
tree --noreport | sed 's/\.gpg$//'
|
||||||
}
|
}
|
||||||
|
|
||||||
yn() {
|
yn() {
|
||||||
|
@ -209,12 +208,8 @@ main() {
|
||||||
c*) pw_copy "$2" ;;
|
c*) pw_copy "$2" ;;
|
||||||
d*) pw_del "$2" ;;
|
d*) pw_del "$2" ;;
|
||||||
s*) pw_show "$2" ;;
|
s*) pw_show "$2" ;;
|
||||||
|
l*) pw_list ;;
|
||||||
# TODO: Better handle the removal
|
t*) pw_tree ;;
|
||||||
# of '.gpg' from list output.
|
|
||||||
l*) pw_list | sed 's/\.gpg$//' ;;
|
|
||||||
t*) pw_tree | sed 's/\.gpg$//' ;;
|
|
||||||
|
|
||||||
*) usage
|
*) usage
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue