Hello,

В Пт, 08/09/2017 в 12:15 +0100, Graham Lyons пишет:
> ... Avoiding use of `compopt` still seems to allow the completion to
> work (I'm guessing there's something missing) so I've prepared a
> patch which tests for its existence first. ...

Another patch variant is attached, without overhead for the Bash 4.x
users.

-- 
WBR,
Nikolay Fetisov
From be3162846e654a31aff698ea7c3d99a1a1ab267c Mon Sep 17 00:00:00 2001
From: "Nikolay A. Fetisov" <n...@altlinux.org>
Date: Mon, 25 Sep 2017 09:26:12 +0000
Subject: [PATCH] Fix Bash completion to work with Bash 3.x

There are no 'compopt' in Bash 3.x - ignore it without error output.
---
 src/completion/pass.bash-completion | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/completion/pass.bash-completion b/src/completion/pass.bash-completion
index 456485b..28fcffc 100644
--- a/src/completion/pass.bash-completion
+++ b/src/completion/pass.bash-completion
@@ -54,7 +54,7 @@ _pass_complete_entries () {
 	# The only time we want to add a space to the end is if there is only
 	# one match, and it is not a directory
 	if [[ $i -gt 1 || ( $i -eq 1 && -d $firstitem ) ]]; then
-		compopt -o nospace
+		compopt -o nospace 2>/dev/null ||:
 	fi
 }
 
@@ -88,7 +88,7 @@ _pass()
 			init)
 				if [[ $lastarg == "-p" || $lastarg == "--path" ]]; then
 					_pass_complete_folders
-					compopt -o nospace
+					compopt -o nospace 2>/dev/null ||:
 				else
 					COMPREPLY+=($(compgen -W "-p --path" -- ${cur}))
 					_pass_complete_keys
-- 
2.10.4

_______________________________________________
Password-Store mailing list
Password-Store@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/password-store

Reply via email to