[Patch] add '-C store-dir' option to switch password store dir

lio at lunesu.com lio at lunesu.com
Wed Jan 30 11:59:44 CET 2019


diff --git a/src/password-store.sh b/src/password-store.sh
index d89d455..c7bffa7 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -13,6 +13,10 @@ which gpg2 &>/dev/null && GPG="gpg2"
[[ -n $GPG_AGENT_INFO || $GPG == "gpg2" ]] && GPG_OPTS+=( "--batch" "--use-agent" )

PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
+if [[ $# -ge 2 && $1 == "-C" ]]; then
+       PREFIX="$2"
+       shift 2
+fi
EXTENSIONS="${PASSWORD_STORE_EXTENSIONS_DIR:-$PREFIX/.extensions}"
X_SELECTION="${PASSWORD_STORE_X_SELECTION:-clipboard}"
CLIP_TIME="${PASSWORD_STORE_CLIP_TIME:-45}"
@@ -243,7 +247,7 @@ cmd_version() {
       ============================================
       = pass: the standard unix password manager =
       =                                          =
-       =                  v1.7.3                  =
+       =                  v1.7.4                  =
       =                                          =
       =             Jason A. Donenfeld           =
       =               Jason at zx2c4.com            =
@@ -257,7 +261,8 @@ cmd_usage() {
       cmd_version
       echo
       cat <<-_EOF
-       Usage:
+       Usage: $PROGRAM [-C store-dir] command [args...]
+
           $PROGRAM init [--path=subfolder,-p subfolder] gpg-id...
               Initialize new password storage and use gpg-id for encryption.
               Selectively reencrypt existing passwords using new gpg-id.




More information about the Password-Store mailing list