Use PW_LEN to override default pw length Signed-off-by: Anirudh Oppiliappan <x@icyphox.sh>
Anirudh Oppiliappan x@icyphox.sh
Mon, 18 Nov 2019 10:22:22 +0530
M
pw
→
pw
@@ -22,7 +22,8 @@
if [[ "$#" -eq 2 ]]; then pass="$2" else - pass="$(pwgen 25 1 -s)" + # uses default length of 25 chars, unless PW_LEN is set + pass="$(pwgen ${PW_LEN:-25} 1 -s)" echo "pw: generated password for $1" fi if [[ ! -f "$PW_DIR/$1.gpg" ]]; then@@ -80,6 +81,7 @@ -d Delete password.
-h Display this help message and exit. Requires PW_KEY to be set. Optionally, set PW_DIR for custom directory location. +Set PW_LEN to an integer of your choice, to override the default password length of 25. " echo "$usage"
M
readme.md
→
readme.md
@@ -18,7 +18,8 @@ ```
This is your GPG key's associated email ID. Optionally, you may set `PW_DIR` to your desired path to change the -default password store location, which is `~/.pw`. +default password store location, which is `~/.pw`. To override the +default password length of 25, set `PW_LEN` to a number of your choice. ``` pw - mnml password manager