add support for unlimited categories
This commit is contained in:
parent
6a972b9ca2
commit
0dabf88875
7
pash
7
pash
|
@ -19,6 +19,10 @@ pw_add() {
|
||||||
[[ $password ]] ||
|
[[ $password ]] ||
|
||||||
die "Failed to generate a password."
|
die "Failed to generate a password."
|
||||||
|
|
||||||
|
# Handle category in store name.
|
||||||
|
[[ $1 == */* ]] &&
|
||||||
|
mkdir -p "${1%/*}" || die "Couldn't create category '$1'."
|
||||||
|
|
||||||
gpg2 -co "$1.gpg" <<< "$password"
|
gpg2 -co "$1.gpg" <<< "$password"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +40,8 @@ pw_show() {
|
||||||
}
|
}
|
||||||
|
|
||||||
pw_list() {
|
pw_list() {
|
||||||
pw_files=(*.gpg)
|
shopt -s globstar
|
||||||
|
pw_files=(**/*.gpg)
|
||||||
|
|
||||||
[[ ! -f ${pw_files[0]} ]] && {
|
[[ ! -f ${pw_files[0]} ]] && {
|
||||||
printf '%s\n' "No stored passwords."
|
printf '%s\n' "No stored passwords."
|
||||||
|
|
Loading…
Reference in New Issue