pash: Split list into list + tree
This commit is contained in:
parent
369514574b
commit
fa4547f2de
@ -59,6 +59,7 @@ COMMANDS
|
|||||||
[d]el [name] - Delete a password entry.
|
[d]el [name] - Delete a password entry.
|
||||||
[l]ist - List all entries.
|
[l]ist - List all entries.
|
||||||
[s]how [name] - Show password for an entry.
|
[s]how [name] - Show password for an entry.
|
||||||
|
[t]ree - List all entries in a tree.
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
|
|
||||||
|
16
pash
16
pash
@ -84,13 +84,15 @@ pw_copy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pw_list() {
|
pw_list() {
|
||||||
if command -v tree >/dev/null 2>&1; then
|
|
||||||
tree --noreport
|
|
||||||
|
|
||||||
else
|
|
||||||
set +f
|
set +f
|
||||||
find -- * -type f -name \*.gpg
|
find -- * -type f -name \*.gpg
|
||||||
fi
|
}
|
||||||
|
|
||||||
|
pw_tree() {
|
||||||
|
command -v tree >/dev/null 2>&1 ||
|
||||||
|
die "'tree' command not found"
|
||||||
|
|
||||||
|
tree --noreport
|
||||||
}
|
}
|
||||||
|
|
||||||
yn() {
|
yn() {
|
||||||
@ -133,13 +135,14 @@ die() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
usage() { printf %s "\
|
usage() { printf %s "\
|
||||||
pash 2.2.1 - simple password manager.
|
pash 2.3.0 - simple password manager.
|
||||||
|
|
||||||
=> [a]dd [name] - Create a new password entry.
|
=> [a]dd [name] - Create a new password entry.
|
||||||
=> [c]opy [name] - Copy entry to the clipboard.
|
=> [c]opy [name] - Copy entry to the clipboard.
|
||||||
=> [d]el [name] - Delete a password entry.
|
=> [d]el [name] - Delete a password entry.
|
||||||
=> [l]ist - List all entries.
|
=> [l]ist - List all entries.
|
||||||
=> [s]how [name] - Show password for an entry.
|
=> [s]how [name] - Show password for an entry.
|
||||||
|
=> [t]ree - List all entries in a tree.
|
||||||
|
|
||||||
Using a key pair: export PASH_KEYID=XXXXXXXX
|
Using a key pair: export PASH_KEYID=XXXXXXXX
|
||||||
Password length: export PASH_LENGTH=50
|
Password length: export PASH_LENGTH=50
|
||||||
@ -211,6 +214,7 @@ main() {
|
|||||||
d*) pw_del "$2" ;;
|
d*) pw_del "$2" ;;
|
||||||
s*) pw_show "$2" ;;
|
s*) pw_show "$2" ;;
|
||||||
l*) pw_list | sed 's/\.gpg$//' ;;
|
l*) pw_list | sed 's/\.gpg$//' ;;
|
||||||
|
t*) pw_tree ;;
|
||||||
*) usage
|
*) usage
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user