Re: [PATCH] Bash 3.x completion support

2017-10-05 Thread Graham Lyons
This looks better.

On 25 September 2017 at 10:56, Nikolay A. Fetisov  wrote:

> 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
> ___
> Password-Store mailing list
> Password-Store@lists.zx2c4.com
> https://lists.zx2c4.com/mailman/listinfo/password-store
>
>
___
Password-Store mailing list
Password-Store@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/password-store


Re: [PATCH] Bash 3.x completion support

2017-09-25 Thread Nikolay A. Fetisov
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 FetisovFrom be3162846e654a31aff698ea7c3d99a1a1ab267c Mon Sep 17 00:00:00 2001
From: "Nikolay A. Fetisov" 
Date: Mon, 25 Sep 2017 09:26:12 +
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


Re: [PATCH] Bash 3.x completion support

2017-09-19 Thread Graham Lyons
I've followed your process, Erik, and re-attached the patch to this email.

Let me know if there are any problems.

Thanks Oliver - I'm trying to avoid installing anything extra.

On 8 September 2017 at 18:45, Oliver Albertini 
wrote:

> Also, you can upgrade your bash version with a package manager. Then you
> have to add it to /etc/shells before changing to the new bash.
>
> On Sep 8, 2017 10:39, "Graham Lyons"  wrote:
>
>> Aha. I just redirected `git diff master` to a file.
>>
>> I'll try your suggestion. Thank you.
>>
>> On 8 Sep 2017 18:23, "Erik Wenzel"  wrote:
>>
>>>
>>> > On 8. Sep 2017, at 13:15, Graham Lyons  wrote:
>>> >
>>> > Hello,
>>> >
>>> > I'm using password-store on OSX (latest, 10.12.6) which comes with
>>> Bash version 3.2.57. I get errors when using the completion as the
>>> `compopt` command doesn't exist before Bash 4. 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.
>>> >
>>> > I hope this is in the right format - let me know if there are any
>>> problems.
>>> The content of your patch fixes my osx bash3 completion issues. Thanks!
>>> The
>>> patch format isn’t right I think. It didn’t apply for me with `git apply
>>> a.patch` and I pasted the content off from your email into `a.patch`. How do
>>> you created the patch?
>>>
>>> When I create the patch using `git format-patch master --stdout >
>>> ../bash3.patch` I get an email header, a stats section and then the patch
>>> like
>>> yours.
>>>
>>> cheers
>>> ___
>>> Password-Store mailing list
>>> Password-Store@lists.zx2c4.com
>>> https://lists.zx2c4.com/mailman/listinfo/password-store
>>>
>>
>> ___
>> Password-Store mailing list
>> Password-Store@lists.zx2c4.com
>> https://lists.zx2c4.com/mailman/listinfo/password-store
>>
>>


bash3.patch
Description: Binary data
___
Password-Store mailing list
Password-Store@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/password-store


Re: [PATCH] Bash 3.x completion support

2017-09-08 Thread Oliver Albertini
Also, you can upgrade your bash version with a package manager. Then you
have to add it to /etc/shells before changing to the new bash.

On Sep 8, 2017 10:39, "Graham Lyons"  wrote:

> Aha. I just redirected `git diff master` to a file.
>
> I'll try your suggestion. Thank you.
>
> On 8 Sep 2017 18:23, "Erik Wenzel"  wrote:
>
>>
>> > On 8. Sep 2017, at 13:15, Graham Lyons  wrote:
>> >
>> > Hello,
>> >
>> > I'm using password-store on OSX (latest, 10.12.6) which comes with Bash
>> version 3.2.57. I get errors when using the completion as the `compopt`
>> command doesn't exist before Bash 4. 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.
>> >
>> > I hope this is in the right format - let me know if there are any
>> problems.
>> The content of your patch fixes my osx bash3 completion issues. Thanks!
>> The
>> patch format isn’t right I think. It didn’t apply for me with `git apply
>> a.patch` and I pasted the content off from your email into `a.patch`. How do
>> you created the patch?
>>
>> When I create the patch using `git format-patch master --stdout >
>> ../bash3.patch` I get an email header, a stats section and then the patch
>> like
>> yours.
>>
>> cheers
>> ___
>> Password-Store mailing list
>> Password-Store@lists.zx2c4.com
>> https://lists.zx2c4.com/mailman/listinfo/password-store
>>
>
> ___
> Password-Store mailing list
> Password-Store@lists.zx2c4.com
> https://lists.zx2c4.com/mailman/listinfo/password-store
>
>
___
Password-Store mailing list
Password-Store@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/password-store


Re: [PATCH] Bash 3.x completion support

2017-09-08 Thread Graham Lyons
Aha. I just redirected `git diff master` to a file.

I'll try your suggestion. Thank you.

On 8 Sep 2017 18:23, "Erik Wenzel"  wrote:

>
> > On 8. Sep 2017, at 13:15, Graham Lyons  wrote:
> >
> > Hello,
> >
> > I'm using password-store on OSX (latest, 10.12.6) which comes with Bash
> version 3.2.57. I get errors when using the completion as the `compopt`
> command doesn't exist before Bash 4. 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.
> >
> > I hope this is in the right format - let me know if there are any
> problems.
> The content of your patch fixes my osx bash3 completion issues. Thanks! The
> patch format isn’t right I think. It didn’t apply for me with `git apply
> a.patch` and I pasted the content off from your email into `a.patch`. How do
> you created the patch?
>
> When I create the patch using `git format-patch master --stdout >
> ../bash3.patch` I get an email header, a stats section and then the patch
> like
> yours.
>
> cheers
> ___
> Password-Store mailing list
> Password-Store@lists.zx2c4.com
> https://lists.zx2c4.com/mailman/listinfo/password-store
>
___
Password-Store mailing list
Password-Store@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/password-store