Hello there! I spent the last few days playing around with pass, so I
forked it [1] and changed the way it handles extensions, because I
wanted to allow extensions to override internal commands. I.E. if
someone wants to modify the way /generate/ works, there's no need to
touch pass's core but simply create an extension named /generate.bash
/and that's all/./

Here's the rough changes list:

  * Modified the way commands are interpreted in the script: replaced
    the switch case selection to a more flexible eval'd one.
  * Changed how extensions are handled: now extensions are loaded first,
    before interpreting the command as an internal command. This allows
    extensions to override internal commands. A helper function is
    provided so that an overridden function can still be called from the
    extension.
  * Issuing help command now shows help from the extensions if they
    implement a function named help_{extension name}(). Otherwise, it
    will list enabled extensions as commands.

This keeps backwards compatibility at 100%, existing extensions are too
100% compatible. So for the final user these patches doesn't have any
effect at all.

Patches and signed hashes are attached.

Also, I tested these and all tests passed (attached as
/tests-result.txt/). Note that tests must be fixed first (see /[PATCH]
Fixes for tests/ [2]).

A sample /pass --help/ output with a couple of extensions I made is
attached (/help-example.txt/).

Attachment list:
0001-Changed-function-switch-based-on-parameters-by-a-mor.patch
0002-Added-helper-override_function-to-enable-extensions-.patch
0003-Modified-cmd_usage-to-show-extensions-usage-help-too.patch
0004-Minor-bugfixes-in-cmd_usage-when-showing-extensions-.patch
0005-Fixed-multiname-functions-parameters-were-not-being-.patch
0006-Small-bugfix-in-usage-command.-Also-changed-spaces-f.patch
SHA512SUMS
SHA512SUMS.sig
help-example.txt
tests-result.txt

Cheers!

[1]: https://github.com/HacKanCuBa/passh
[2]:
https://lists.zx2c4.com/pipermail/password-store/2017-February/002727.html

-- 
HacKan || Iván
GPG: 0x35710D312FDE468B

From f5c11fe1f8d62d10b114c7e550f60cda41461b16 Mon Sep 17 00:00:00 2001
From: HacKan <[email protected]>
Date: Mon, 6 Feb 2017 12:18:55 -0300
Subject: [PATCH 5/5] Fixed multiname functions: parameters were not being
 passed. Fixed cmd_internal: force return 0 if command exists

---
 src/password-store.sh | 39 +++++++++++++++++----------------------
 1 file changed, 17 insertions(+), 22 deletions(-)

diff --git a/src/password-store.sh b/src/password-store.sh
index 8ff3685..94602b8 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -351,8 +351,8 @@ cmd_usage() {
 	
 	echo "More information may be found in the pass(1) man page."
 }
-cmd_help() { cmd_usage; }
-cmd_h() { cmd_usage; }
+cmd_help() { cmd_usage "$@"; }
+cmd_h() { cmd_usage "$@"; }
 
 cmd_init() {
 	local opts id_path=""
@@ -442,8 +442,8 @@ cmd_show() {
 		die "Error: $path is not in the password store."
 	fi
 }
-cmd_ls() { cmd_show; }
-cmd_list() { cmd_show; }
+cmd_ls() { cmd_show "$@"; }
+cmd_list() { cmd_show "$@"; }
 
 cmd_find() {
 	[[ -z "$@" ]] && die "Usage: $PROGRAM $COMMAND pass-names..."
@@ -451,7 +451,7 @@ cmd_find() {
 	local terms="*$(printf '%s*|*' "$@")"
 	tree -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g'
 }
-cmd_search() { cmd_find; }
+cmd_search() { cmd_find "$@"; }
 
 cmd_grep() {
 	[[ $# -ne 1 ]] && die "Usage: $PROGRAM $COMMAND search-string"
@@ -516,7 +516,7 @@ cmd_insert() {
 	fi
 	git_add_file "$passfile" "Add given password for $path to store."
 }
-cmd_add() { cmd_insert; }
+cmd_add() { cmd_insert "$@"; }
 
 cmd_edit() {
 	[[ $# -ne 1 ]] && die "Usage: $PROGRAM $COMMAND pass-name"
@@ -624,8 +624,8 @@ cmd_delete() {
 	fi
 	rmdir -p "${passfile%/*}" 2>/dev/null
 }
-cmd_remove() { cmd_delete; }
-cmd_rm() { cmd_delete; }
+cmd_remove() { cmd_delete "$@"; }
+cmd_rm() { cmd_delete "$@"; }
 
 cmd_copy_move() {
 	local opts move=1 force=0
@@ -672,10 +672,10 @@ cmd_copy_move() {
 		git_add_file "$new_path" "Copy ${1} to ${2}."
 	fi
 }
-rename() { cmd_copy_move "move"; }
-mv() { cmd_copy_move "move"; }
-cp() { cmd_copy_move "copy"; }
-copy() { cmd_copy_move "copy"; }
+cmd_rename() { cmd_copy_move "move" "$@"; }
+cmd_mv() { cmd_copy_move "move" "$@"; }
+cmd_cp() { cmd_copy_move "copy" "$@"; }
+cmd_copy() { cmd_copy_move "copy" "$@"; }
 
 cmd_git() {
 	if [[ $1 == "init" ]]; then
@@ -695,13 +695,6 @@ cmd_git() {
 	fi
 }
 
-cmd_extension_or_show() {
-	if ! cmd_extension "$@"; then
-		COMMAND="show"
-		cmd_show "$@"
-	fi
-}
-
 cmd_internal() {
 	local cmd counter=0
 	cmd="$COMMAND"
@@ -715,8 +708,9 @@ cmd_internal() {
 	# Check if a function exists
 	if type "cmd_${cmd}" > /dev/null 2>&1; then
 		shift
-		eval '"cmd_${cmd}" "$@"' || die
-		
+		eval '"cmd_${cmd}" "$@"'
+		# Internal commands don't handle well return values, but they either 
+		# die (exit 1) or succeed, so fix return value to 0
 		return 0
 	fi
 	
@@ -748,4 +742,5 @@ cmd_internal "$@" && exit 0
 # Assume its an implicit show command
 COMMAND="show"
 cmd_show "$@"
-exit $?
+
+exit 0
-- 
2.11.0

From e39d21e44dabe5d531354b38711435d744177fa9 Mon Sep 17 00:00:00 2001
From: HacKan <[email protected]>
Date: Fri, 3 Feb 2017 12:47:48 -0300
Subject: [PATCH 4/5] Minor bugfixes in cmd_usage() when showing extensions
 help

---
 src/password-store.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/password-store.sh b/src/password-store.sh
index 15b3b22..8ff3685 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -323,10 +323,10 @@ cmd_usage() {
 
 	_EOF
 	
-	if [[ (-n "$SYSTEM_EXTENSION_DIR" && -n "$(ls "$SYSTEM_EXTENSION_DIR")" ) || ($PASSWORD_STORE_ENABLE_EXTENSIONS == true && -n "$(ls "$EXTENSIONS")") ]]; then
+	if [[ (-n "$SYSTEM_EXTENSION_DIR" && -n "$(ls "$SYSTEM_EXTENSION_DIR"/*.bash 2>/dev/null)" ) || ($PASSWORD_STORE_ENABLE_EXTENSIONS == true && -n "$(ls "$EXTENSIONS"/*.bash 2>/dev/null)") ]]; then
 	    echo "From extensions:"
 	    local -a extdirs=( "$SYSTEM_EXTENSION_DIR" "$EXTENSIONS" )
-	    local extdir ext extname exthelp
+	    local extdir ext extname exthelp someextenabled=0
 	    for extdir in ${extdirs[@]}; do
 	        for ext in $(ls $extdir/*.bash); do
 	            if [[ -r "$ext" && -x "$ext" ]]; then
@@ -341,8 +341,10 @@ cmd_usage() {
 	                    # Call it
 	                    eval "${exthelp}; help_${extname%.*}"
 	                fi
+	                someextenabled=1
 	            fi
 	        done
+	        [[ $someextenabled -eq 0 ]] && echo "    (no extensions enabled)"
 	    done
 	    echo
 	fi
-- 
2.11.0

From abd2a5edf1d79e4b0e510361fb70970f8b226eea Mon Sep 17 00:00:00 2001
From: HacKan <[email protected]>
Date: Thu, 2 Feb 2017 16:22:49 -0300
Subject: [PATCH 3/5] Modified cmd_usage() to show extensions usage help too,
 as long as they have a help_extensionname() function, or otherwise show only
 the extension name.

---
 src/password-store.sh | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/src/password-store.sh b/src/password-store.sh
index 39e069f..15b3b22 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -321,8 +321,33 @@ cmd_usage() {
 	    $PROGRAM version
 	        Show version information.
 
-	More information may be found in the pass(1) man page.
 	_EOF
+	
+	if [[ (-n "$SYSTEM_EXTENSION_DIR" && -n "$(ls "$SYSTEM_EXTENSION_DIR")" ) || ($PASSWORD_STORE_ENABLE_EXTENSIONS == true && -n "$(ls "$EXTENSIONS")") ]]; then
+	    echo "From extensions:"
+	    local -a extdirs=( "$SYSTEM_EXTENSION_DIR" "$EXTENSIONS" )
+	    local extdir ext extname exthelp
+	    for extdir in ${extdirs[@]}; do
+	        for ext in $(ls $extdir/*.bash); do
+	            if [[ -r "$ext" && -x "$ext" ]]; then
+	                # Extract help function, that must be called as help_extensionname()
+	                extname="$(basename "$ext")"
+	                exthelp="$(sed -nE "/^(function)?\s?help_${extname%.*}\(\)/,/^}/p" "$ext")"
+	                if [[ -z "$exthelp" ]]; then
+	                    # Function inexistent
+	                    echo "    $PROGRAM ${extname%.*}"
+	                    echo "        (no help available)"
+	                else
+	                    # Call it
+	                    eval "${exthelp}; help_${extname%.*}"
+	                fi
+	            fi
+	        done
+	    done
+	    echo
+	fi
+	
+	echo "More information may be found in the pass(1) man page."
 }
 cmd_help() { cmd_usage; }
 cmd_h() { cmd_usage; }
-- 
2.11.0

From 446981f5059204493e20100d9204892a70282c9e Mon Sep 17 00:00:00 2001
From: HacKan <[email protected]>
Date: Tue, 31 Jan 2017 21:09:34 -0300
Subject: [PATCH 2/5] Added helper override_function() to enable extensions to
 override but use internal functions. Overriden functions are renamed to
 pass_{function name}.

---
 src/password-store.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/password-store.sh b/src/password-store.sh
index b304bcd..39e069f 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -155,6 +155,21 @@ check_extension_and_load() {
 	return 0
 }
 
+override_function() {
+	# Recieves a function name, and it renames it to pass_<function name>
+	# based on http://mivok.net/2009/09/20/bashfunctionoverrist.html
+	local func="$1"
+	
+	if type "$func" > /dev/null 2>&1; then
+		local contents=$(declare -f $func)
+		local newname="pass_${func}${contents#$func}"
+		eval "$newname"
+		return $?
+	fi
+	
+	return 1
+}
+
 #
 # END helper functions
 #
-- 
2.11.0

From 6b0d60e8c22f370ba4c19f4eb1b31612b4387bbb Mon Sep 17 00:00:00 2001
From: HacKan <[email protected]>
Date: Tue, 31 Jan 2017 20:34:39 -0300
Subject: [PATCH 1/5] Changed function switch based on parameters by a more
 flexible desing using eval. Now read user extensions first, so even internal
 commmands can be overridden.

---
 src/password-store.sh | 101 +++++++++++++++++++++++++++++++++-----------------
 1 file changed, 68 insertions(+), 33 deletions(-)

diff --git a/src/password-store.sh b/src/password-store.sh
index 081057a..b304bcd 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -136,6 +136,25 @@ check_sneaky_paths() {
 	done
 }
 
+SYSTEM_EXTENSION_DIR=""
+check_extension_and_load() {
+	check_sneaky_paths "$1"
+	local user_extension system_extension extension
+	[[ -n $SYSTEM_EXTENSION_DIR ]] && system_extension="$SYSTEM_EXTENSION_DIR/$1.bash"
+	[[ $PASSWORD_STORE_ENABLE_EXTENSIONS == true ]] && user_extension="$EXTENSIONS/$1.bash"
+	if [[ -n $user_extension && -f $user_extension && -x $user_extension ]]; then
+		verify_file "$user_extension"
+		extension="$user_extension"
+	elif [[ -n $system_extension && -f $system_extension && -x $system_extension ]]; then
+		extension="$system_extension"
+	else
+		return 1
+	fi
+	shift
+	source "$extension" "$@"
+	return 0
+}
+
 #
 # END helper functions
 #
@@ -290,6 +309,8 @@ cmd_usage() {
 	More information may be found in the pass(1) man page.
 	_EOF
 }
+cmd_help() { cmd_usage; }
+cmd_h() { cmd_usage; }
 
 cmd_init() {
 	local opts id_path=""
@@ -379,6 +400,8 @@ cmd_show() {
 		die "Error: $path is not in the password store."
 	fi
 }
+cmd_ls() { cmd_show; }
+cmd_list() { cmd_show; }
 
 cmd_find() {
 	[[ -z "$@" ]] && die "Usage: $PROGRAM $COMMAND pass-names..."
@@ -386,6 +409,7 @@ cmd_find() {
 	local terms="*$(printf '%s*|*' "$@")"
 	tree -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g'
 }
+cmd_search() { cmd_find; }
 
 cmd_grep() {
 	[[ $# -ne 1 ]] && die "Usage: $PROGRAM $COMMAND search-string"
@@ -450,6 +474,7 @@ cmd_insert() {
 	fi
 	git_add_file "$passfile" "Add given password for $path to store."
 }
+cmd_add() { cmd_insert; }
 
 cmd_edit() {
 	[[ $# -ne 1 ]] && die "Usage: $PROGRAM $COMMAND pass-name"
@@ -557,6 +582,8 @@ cmd_delete() {
 	fi
 	rmdir -p "${passfile%/*}" 2>/dev/null
 }
+cmd_remove() { cmd_delete; }
+cmd_rm() { cmd_delete; }
 
 cmd_copy_move() {
 	local opts move=1 force=0
@@ -603,6 +630,10 @@ cmd_copy_move() {
 		git_add_file "$new_path" "Copy ${1} to ${2}."
 	fi
 }
+rename() { cmd_copy_move "move"; }
+mv() { cmd_copy_move "move"; }
+cp() { cmd_copy_move "copy"; }
+copy() { cmd_copy_move "copy"; }
 
 cmd_git() {
 	if [[ $1 == "init" ]]; then
@@ -629,23 +660,25 @@ cmd_extension_or_show() {
 	fi
 }
 
-SYSTEM_EXTENSION_DIR=""
-cmd_extension() {
-	check_sneaky_paths "$1"
-	local user_extension system_extension extension
-	[[ -n $SYSTEM_EXTENSION_DIR ]] && system_extension="$SYSTEM_EXTENSION_DIR/$1.bash"
-	[[ $PASSWORD_STORE_ENABLE_EXTENSIONS == true ]] && user_extension="$EXTENSIONS/$1.bash"
-	if [[ -n $user_extension && -f $user_extension && -x $user_extension ]]; then
-		verify_file "$user_extension"
-		extension="$user_extension"
-	elif [[ -n $system_extension && -f $system_extension && -x $system_extension ]]; then
-		extension="$system_extension"
-	else
-		return 1
+cmd_internal() {
+	local cmd counter=0
+	cmd="$COMMAND"
+	
+	# Remove dashes (up to 2)
+	while [[ "$(expr index "$cmd" '-')" == "1" && $counter -lt 2 ]]; do
+		cmd="${cmd:1}"
+		let counter+=1
+	done
+	
+	# Check if a function exists
+	if type "cmd_${cmd}" > /dev/null 2>&1; then
+		shift
+		eval '"cmd_${cmd}" "$@"' || die
+		
+		return 0
 	fi
-	shift
-	source "$extension" "$@"
-	return 0
+	
+	return 1
 }
 
 #
@@ -655,20 +688,22 @@ cmd_extension() {
 PROGRAM="${0##*/}"
 COMMAND="$1"
 
-case "$1" in
-	init) shift;			cmd_init "$@" ;;
-	help|--help) shift;		cmd_usage "$@" ;;
-	version|--version) shift;	cmd_version "$@" ;;
-	show|ls|list) shift;		cmd_show "$@" ;;
-	find|search) shift;		cmd_find "$@" ;;
-	grep) shift;			cmd_grep "$@" ;;
-	insert|add) shift;		cmd_insert "$@" ;;
-	edit) shift;			cmd_edit "$@" ;;
-	generate) shift;		cmd_generate "$@" ;;
-	delete|rm|remove) shift;	cmd_delete "$@" ;;
-	rename|mv) shift;		cmd_copy_move "move" "$@" ;;
-	copy|cp) shift;			cmd_copy_move "copy" "$@" ;;
-	git) shift;			cmd_git "$@" ;;
-	*)				cmd_extension_or_show "$@" ;;
-esac
-exit 0
+# Check if command is an extension
+check_extension_and_load "$@" && exit 0
+
+# Check if command is internal command
+#
+# Internal commands must begin with cmd_ and named like cmd_command
+# Multiname functions such as delete=remove=rm can be done like 
+#  cmd_remove() { cmd_delete; }
+#  cmd_rm() { cmd_delete; }
+# Others like help=--help are handled by cmd_internal() as long as a function 
+# exists without --
+# Bear in mind that aliases are not expanded by eval (used in cmd_internal), 
+# so creating functions is a better way to go.
+cmd_internal "$@" && exit 0
+
+# Assume its an implicit show command
+COMMAND="show"
+cmd_show "$@"
+exit $?
-- 
2.11.0

Running all enabled tests...

Running: t0001-sanity-checks.sh
ok 1 - Make sure we can run pass
ok 2 - Make sure we can initialize our test store
# passed all 2 test(s)
1..2
Done

Running: t0010-generate-tests.sh
ok 1 - Test "generate" command
ok 2 - Test replacement of first line
ok 3 - Test replacement of first line with random
# passed all 3 test(s)
1..3
Done

Running: t0020-show-tests.sh
ok 1 - Test "show" command
ok 2 - Test "show" command with spaces
ok 3 - Test "show" of nonexistant password
# passed all 3 test(s)
1..3
Done

Running: t0050-mv-tests.sh
ok 1 - Basic move command
ok 2 - Directory creation
ok 3 - Directory creation with file rename and empty directory removal
ok 4 - Directory rename
ok 5 - Directory move into new directory
ok 6 - Multi-directory creation and multi-directory empty removal
ok 7 - Password made it until the end
ok 8 - Git is consistent
# passed all 8 test(s)
1..8
Done

Running: t0060-rm-tests.sh
ok 1 - Test "rm" command
ok 2 - Test "rm" command with spaces
ok 3 - Test "rm" of non-existent password
# passed all 3 test(s)
1..3
Done

Running: t0100-insert-tests.sh
ok 1 - Test "insert" command
# passed all 1 test(s)
1..1
Done

Running: t0200-edit-tests.sh
ok 1 - Test "edit" command
# passed all 1 test(s)
1..1
Done

Running: t0300-reencryption.sh
ok 1 - Setup initial key and git
ok 2 - Root key encryption
ok 3 - Reencryption root single key
ok 4 - Reencryption root multiple key
ok 5 - Reencryption root multiple key with string
ok 6 - Reencryption root group
ok 7 - Reencryption root group with spaces
ok 8 - Reencryption root group with spaces and other keys
ok 9 - Reencryption root group and other keys
ok 10 - Reencryption root group to identical individual with no file change
ok 11 - Reencryption subfolder multiple keys, copy
ok 12 - Reencryption subfolder multiple keys, move, deinit
ok 13 - Password lived through all transformations
ok 14 - Git picked up all changes throughout
# passed all 14 test(s)
1..14
Done

Running: t0400-grep.sh
ok 1 - Make sure grep prints normal lines
# passed all 1 test(s)
1..1
Done

Running: t0500-find.sh
ok 1 - Make sure find resolves correct files
# passed all 1 test(s)
1..1
Done

All enabled tests executed, have a nice day
============================================
= pass: the standard unix password manager =
=                                          =
=                  v1.6.5                  =
=                                          =
=             Jason A. Donenfeld           =
=               [email protected]            =
=                                          =
=      http://www.passwordstore.org/       =
============================================

Usage:
    pass 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.
    pass [ls] [subfolder]
        List passwords.
    pass find pass-names...
        List passwords that match pass-names.
    pass [show] [--clip[=line-number],-c[line-number]] pass-name
        Show existing password and optionally put it on the clipboard.
        If put on the clipboard, it will be cleared in 12 seconds.
    pass grep search-string
        Search for password files containing search-string when decrypted.
    pass insert [--echo,-e | --multiline,-m] [--force,-f] pass-name
        Insert new password. Optionally, echo the password back to the console
        during entry. Or, optionally, the entry may be multiline. Prompt before
        overwriting existing password unless forced.
    pass edit pass-name
        Insert a new password or edit an existing password using vi.
    pass generate [--no-symbols,-n] [--clip,-c] [--in-place,-i | --force,-f] 
pass-name [pass-length]
        Generate a new password of pass-length (or 20 if unspecified) with 
optionally no symbols.
        Optionally put it on the clipboard and clear board after 12 seconds.
        Prompt before overwriting existing password unless forced.
        Optionally replace only the first line of an existing file with a new 
password.
    pass rm [--recursive,-r] [--force,-f] pass-name
        Remove existing password or directory, optionally forcefully.
    pass mv [--force,-f] old-path new-path
        Renames or moves old-path to new-path, optionally forcefully, 
selectively reencrypting.
    pass cp [--force,-f] old-path new-path
        Copies old-path to new-path, optionally forcefully, selectively 
reencrypting.
    pass git git-command-args...
        If the password store is a git repository, execute a git command
        specified by git-command-args.
    pass help
        Show this text.
    pass version
        Show version information.

From extensions:
    pass init [--path=subfolder,-p subfolder] [--git,-g] [--sign,-s] gpg-id
        Initialize new password storage and use gpg-id for encryption.
        Selectively reencrypt existing passwords using new gpg-id.
        Additionally, --git or -g initializes the git repository (same as 
        pass git init).
        Optionally, --sign or -s can be passed to temporarily set 
        PASSWORD_STORE_SIGNING_KEY to gpg-ip.
        If PASSWORD_STORE_SIGNING_KEY is set (either by --sign or 
        externally), it will be used to sign gpg-id files and also commits 
        (if git is initialized or already exists). Note that only the first 
        key in PASSWORD_STORE_SIGNING_KEY is used to sign commits! (this is
        a git limitation).
    pass insert [--echo,-e | --multiline,-m] [--force,-f] pass-name [file-path]
        Insert new password. Optionally, echo the password back to the console
        during entry. Or, the entry may be multiline. 
        If file-path is a file, it will be inserted (options for 
        echo and multiline are ignored)
        Prompt before overwriting existing password or file unless forced.

More information may be found in the pass(1) man page.
From f274700ee8a7bef85664119cf343d1e60bf77099 Mon Sep 17 00:00:00 2001
From: HacKan <[email protected]>
Date: Mon, 6 Feb 2017 13:32:17 -0300
Subject: [PATCH 6/6] Small bugfix in usage command. Also, changed spaces for
 tabs there

---
 src/password-store.sh | 46 +++++++++++++++++++++++-----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/password-store.sh b/src/password-store.sh
index 94602b8..fcf2035 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -324,29 +324,29 @@ cmd_usage() {
 	_EOF
 	
 	if [[ (-n "$SYSTEM_EXTENSION_DIR" && -n "$(ls "$SYSTEM_EXTENSION_DIR"/*.bash 2>/dev/null)" ) || ($PASSWORD_STORE_ENABLE_EXTENSIONS == true && -n "$(ls "$EXTENSIONS"/*.bash 2>/dev/null)") ]]; then
-	    echo "From extensions:"
-	    local -a extdirs=( "$SYSTEM_EXTENSION_DIR" "$EXTENSIONS" )
-	    local extdir ext extname exthelp someextenabled=0
-	    for extdir in ${extdirs[@]}; do
-	        for ext in $(ls $extdir/*.bash); do
-	            if [[ -r "$ext" && -x "$ext" ]]; then
-	                # Extract help function, that must be called as help_extensionname()
-	                extname="$(basename "$ext")"
-	                exthelp="$(sed -nE "/^(function)?\s?help_${extname%.*}\(\)/,/^}/p" "$ext")"
-	                if [[ -z "$exthelp" ]]; then
-	                    # Function inexistent
-	                    echo "    $PROGRAM ${extname%.*}"
-	                    echo "        (no help available)"
-	                else
-	                    # Call it
-	                    eval "${exthelp}; help_${extname%.*}"
-	                fi
-	                someextenabled=1
-	            fi
-	        done
-	        [[ $someextenabled -eq 0 ]] && echo "    (no extensions enabled)"
-	    done
-	    echo
+		echo "From extensions:"
+		local -a extdirs=( "$SYSTEM_EXTENSION_DIR" "$EXTENSIONS" )
+		local extdir ext extname exthelp someextenabled=0
+		for extdir in "${extdirs[@]}"; do
+			for ext in "$extdir"/*.bash; do
+				if [[ -r "$ext" && -x "$ext" ]]; then
+					# Extract help function, that must be called as help_extensionname()
+					extname="$(basename "$ext")"
+					exthelp="$(sed -nE "/^(function)?\s?help_${extname%.*}\(\)/,/^}/p" "$ext")"
+					if [[ -z "$exthelp" ]]; then
+						# Function inexistent
+						echo "    $PROGRAM ${extname%.*}"
+						echo "        (no help available)"
+					else
+						# Call it
+						eval "${exthelp}; help_${extname%.*}"
+					fi
+					someextenabled=1
+				fi
+			done
+		done
+		[[ $someextenabled -eq 0 ]] && echo "    (no extensions enabled)"
+		echo
 	fi
 	
 	echo "More information may be found in the pass(1) man page."
-- 
2.11.0

c61e47b84e2e7318c3366f586e87304722646a197f21d895c42801435cd670cca007c666e8edcc102048acc5150cb6f42857fa78dc113d9ecb271571fd4ac36d
  0001-Changed-function-switch-based-on-parameters-by-a-mor.patch
d6781bf10dcf154c48a548bb782ffb72db65fdacc9e0da1d4f6381ffb064239929419b9b54a6a01007d0f9c8cbe61c99d26be0f7d7c37efabafed69d98079fe4
  0002-Added-helper-override_function-to-enable-extensions-.patch
85d6b9ae376e42be0a8101055f2ea196fe453fd5985015884c424d6be6af4689a0eee6f813c5362dff4f79e751c17e623371d897665f69c305d6219c8fa63d38
  0003-Modified-cmd_usage-to-show-extensions-usage-help-too.patch
4dd01d2762e6988cf83841ce12939a1bcfce99939f01c75111c2e66e535454fbd1ed09e68bc92660114b18ffd19e173981f40dd23916d00ed443199d1e5de8da
  0004-Minor-bugfixes-in-cmd_usage-when-showing-extensions-.patch
730af4c505ec80fa2bacf32f5b6e8374718b928fda568a0aa628c9aed451c8eb58f6e6a2ab874383840d2084e485456bade09b32c6a2ef9d02ec106d42c8f76c
  0005-Fixed-multiname-functions-parameters-were-not-being-.patch
6e287545124086fdfae2402d85a278fc38a41bdeefd3fdb5c00aa65c0fa99b34f2222d02f139298dff042cf6482a5ff79fcae249a60aee3bc71645b438e9a453
  0006-Small-bugfix-in-usage-command.-Also-changed-spaces-f.patch

Attachment: SHA512SUMS.sig
Description: PGP signature

_______________________________________________
Password-Store mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/password-store

Reply via email to