pash: better listing

This commit is contained in:
Dylan Araps 2019-11-30 16:29:32 +00:00
parent 86d72380ba
commit 3065aa621a
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 4 additions and 9 deletions

13
pash
View File

@ -84,15 +84,14 @@ pw_copy() {
}
pw_list() {
set +f
find -- * -type f -name \*.gpg
find . -type f -name \*.gpg | sed 's/..//;s/\.gpg$//'
}
pw_tree() {
command -v tree >/dev/null 2>&1 ||
die "'tree' command not found"
tree --noreport
tree --noreport | sed 's/\.gpg$//'
}
yn() {
@ -209,12 +208,8 @@ main() {
c*) pw_copy "$2" ;;
d*) pw_del "$2" ;;
s*) pw_show "$2" ;;
# TODO: Better handle the removal
# of '.gpg' from list output.
l*) pw_list | sed 's/\.gpg$//' ;;
t*) pw_tree | sed 's/\.gpg$//' ;;
l*) pw_list ;;
t*) pw_tree ;;
*) usage
esac
}