GNU bug report logs - #30495
[PATCH] bash completion: Complete files names after 'guix package -m'.

Previous Next

Package: guix-patches;

Reported by: Oleg Pykhalov <go.wigust <at> gmail.com>

Date: Sat, 17 Feb 2018 09:09:02 UTC

Severity: normal

Tags: patch

Done: Oleg Pykhalov <go.wigust <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30495 in the body.
You can then email your comments to 30495 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#30495; Package guix-patches. (Sat, 17 Feb 2018 09:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 17 Feb 2018 09:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH] bash completion: Complete files names after 'guix package -m'.
Date: Sat, 17 Feb 2018 12:07:38 +0300
* etc/completion/bash/guix (_guix_is_dash_L): Replace with
‘_guix_is_dash_L_or_m’.
(_guix_complete): Add this.
---
 etc/completion/bash/guix | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
index 6b84193db..286c4f1c5 100644
--- a/etc/completion/bash/guix
+++ b/etc/completion/bash/guix
@@ -97,9 +97,10 @@ _guix_is_removing ()
     $result
 }
 
-_guix_is_dash_L ()
+_guix_is_dash_L_or_m ()
 {
-    [ "${COMP_WORDS[$COMP_CWORD - 1]}" = "-L" ] \
+    comp_words_minus_1="${COMP_WORDS[$COMP_CWORD - 1]}"
+    [ "$comp_words_minus_1" = "-L" ] || [ "$comp_words_minus_1" = "-m" ] \
 	|| { case "${COMP_WORDS[$COMP_CWORD]}" in
 		 --load-path=*) true;;
 		 *)             false;;
@@ -149,7 +150,7 @@ _guix_complete ()
 	*)
 	    if _guix_is_command "package"
 	    then
-		if _guix_is_dash_L
+		if _guix_is_dash_L_or_m
 		then
 		    _guix_complete_file
 		elif _guix_is_removing
-- 
2.16.1





Information forwarded to guix-patches <at> gnu.org:
bug#30495; Package guix-patches. (Sat, 17 Feb 2018 15:46:02 GMT) Full text and rfc822 format available.

Message #8 received at 30495 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Oleg Pykhalov <go.wigust <at> gmail.com>, 30495 <at> debbugs.gnu.org
Subject: Re: [bug#30495] [PATCH] bash completion: Complete files names after
 'guix package -m'.
Date: Sat, 17 Feb 2018 16:45:42 +0100
[Message part 1 (text/plain, inline)]
Oleg Pykhalov <go.wigust <at> gmail.com> writes:

> * etc/completion/bash/guix (_guix_is_dash_L): Replace with
> ‘_guix_is_dash_L_or_m’.
> (_guix_complete): Add this.

[...]

> diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
> index 6b84193db..286c4f1c5 100644
> --- a/etc/completion/bash/guix
> +++ b/etc/completion/bash/guix
> @@ -97,9 +97,10 @@ _guix_is_removing ()
>      $result
>  }
>  
> -_guix_is_dash_L ()
> +_guix_is_dash_L_or_m ()
>  {
> -    [ "${COMP_WORDS[$COMP_CWORD - 1]}" = "-L" ] \
> +    comp_words_minus_1="${COMP_WORDS[$COMP_CWORD - 1]}"
> +    [ "$comp_words_minus_1" = "-L" ] || [ "$comp_words_minus_1" = "-m" ] \
>  	|| { case "${COMP_WORDS[$COMP_CWORD]}" in
>  		 --load-path=*) true;;
>  		 *)             false;;

I think this fails to account for the long form "--manifest".  Perhaps
it's better to add a new "_guix_is_dash_m" and use

"if _guix_is_dash_L || _guix_is_dash_m"

below.  WDYT?

> @@ -149,7 +150,7 @@ _guix_complete ()
>  	*)
>  	    if _guix_is_command "package"
>  	    then
> -		if _guix_is_dash_L
> +		if _guix_is_dash_L_or_m
>  		then
>  		    _guix_complete_file
>  		elif _guix_is_removing
> -- 
> 2.16.1
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#30495; Package guix-patches. (Sat, 17 Feb 2018 16:04:02 GMT) Full text and rfc822 format available.

Message #11 received at 30495 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 30495 <at> debbugs.gnu.org
Subject: Re: [bug#30495] [PATCH] bash completion: Complete files names after
 'guix package -m'.
Date: Sat, 17 Feb 2018 19:03:11 +0300
[Message part 1 (text/plain, inline)]
Marius Bakke <mbakke <at> fastmail.com> writes:

> Oleg Pykhalov <go.wigust <at> gmail.com> writes:
>
>> * etc/completion/bash/guix (_guix_is_dash_L): Replace with
>> ‘_guix_is_dash_L_or_m’.
>> (_guix_complete): Add this.
>
> [...]
>
>> diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
>> index 6b84193db..286c4f1c5 100644
>> --- a/etc/completion/bash/guix
>> +++ b/etc/completion/bash/guix
>> @@ -97,9 +97,10 @@ _guix_is_removing ()
>>      $result
>>  }
>>  
>> -_guix_is_dash_L ()
>> +_guix_is_dash_L_or_m ()
>>  {
>> -    [ "${COMP_WORDS[$COMP_CWORD - 1]}" = "-L" ] \
>> +    comp_words_minus_1="${COMP_WORDS[$COMP_CWORD - 1]}"
>> +    [ "$comp_words_minus_1" = "-L" ] || [ "$comp_words_minus_1" = "-m" ] \
>>  	|| { case "${COMP_WORDS[$COMP_CWORD]}" in
>>  		 --load-path=*) true;;
>>  		 *)             false;;
>
> I think this fails to account for the long form "--manifest".  Perhaps
> it's better to add a new "_guix_is_dash_m" and use
>
> "if _guix_is_dash_L || _guix_is_dash_m"
>
> below.  WDYT?

Nice catch!  Thanks.

But I don't know how to implement a file completion for ‘--manifest=’.
‘--load-path=’ doesn't have a file completion too.  Only completion for
equal sign before.

Oleg.

[0001-bash-completion-Complete-files-names-after-guix-pack.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#30495; Package guix-patches. (Sat, 17 Feb 2018 16:15:01 GMT) Full text and rfc822 format available.

Message #14 received at 30495 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: 30495 <at> debbugs.gnu.org
Subject: Re: [bug#30495] [PATCH] bash completion: Complete files names after
 'guix package -m'.
Date: Sat, 17 Feb 2018 17:14:48 +0100
[Message part 1 (text/plain, inline)]
Oleg Pykhalov <go.wigust <at> gmail.com> writes:

> Marius Bakke <mbakke <at> fastmail.com> writes:
>
>> Oleg Pykhalov <go.wigust <at> gmail.com> writes:
>>
>>> * etc/completion/bash/guix (_guix_is_dash_L): Replace with
>>> ‘_guix_is_dash_L_or_m’.
>>> (_guix_complete): Add this.
>>
>> [...]
>>
>>> diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
>>> index 6b84193db..286c4f1c5 100644
>>> --- a/etc/completion/bash/guix
>>> +++ b/etc/completion/bash/guix
>>> @@ -97,9 +97,10 @@ _guix_is_removing ()
>>>      $result
>>>  }
>>>  
>>> -_guix_is_dash_L ()
>>> +_guix_is_dash_L_or_m ()
>>>  {
>>> -    [ "${COMP_WORDS[$COMP_CWORD - 1]}" = "-L" ] \
>>> +    comp_words_minus_1="${COMP_WORDS[$COMP_CWORD - 1]}"
>>> +    [ "$comp_words_minus_1" = "-L" ] || [ "$comp_words_minus_1" = "-m" ] \
>>>  	|| { case "${COMP_WORDS[$COMP_CWORD]}" in
>>>  		 --load-path=*) true;;
>>>  		 *)             false;;
>>
>> I think this fails to account for the long form "--manifest".  Perhaps
>> it's better to add a new "_guix_is_dash_m" and use
>>
>> "if _guix_is_dash_L || _guix_is_dash_m"
>>
>> below.  WDYT?
>
> Nice catch!  Thanks.
>
> But I don't know how to implement a file completion for ‘--manifest=’.
> ‘--load-path=’ doesn't have a file completion too.  Only completion for
> equal sign before.

Oh, OK.  That's another issue I guess.  The patch below LGTM, but the
commit message needs adjusting ;-)

Thank you!
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#30495; Package guix-patches. (Sat, 17 Feb 2018 19:26:01 GMT) Full text and rfc822 format available.

Message #17 received at 30495 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 30495-done <at> debbugs.gnu.org, 30495 <at> debbugs.gnu.org
Subject: Re: [bug#30495] [PATCH] bash completion: Complete files names after
 'guix package -m'.
Date: Sat, 17 Feb 2018 22:25:11 +0300
[Message part 1 (text/plain, inline)]
Marius Bakke <mbakke <at> fastmail.com> writes:

> Oleg Pykhalov <go.wigust <at> gmail.com> writes:
>
>> Marius Bakke <mbakke <at> fastmail.com> writes:
>>
>>> Oleg Pykhalov <go.wigust <at> gmail.com> writes:
>>>
>>>> * etc/completion/bash/guix (_guix_is_dash_L): Replace with
>>>> ‘_guix_is_dash_L_or_m’.
>>>> (_guix_complete): Add this.
>>>
>>> [...]
>>>
>>>> diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
>>>> index 6b84193db..286c4f1c5 100644
>>>> --- a/etc/completion/bash/guix
>>>> +++ b/etc/completion/bash/guix
>>>> @@ -97,9 +97,10 @@ _guix_is_removing ()
>>>>      $result
>>>>  }
>>>>  
>>>> -_guix_is_dash_L ()
>>>> +_guix_is_dash_L_or_m ()
>>>>  {
>>>> -    [ "${COMP_WORDS[$COMP_CWORD - 1]}" = "-L" ] \
>>>> +    comp_words_minus_1="${COMP_WORDS[$COMP_CWORD - 1]}"
>>>> +    [ "$comp_words_minus_1" = "-L" ] || [ "$comp_words_minus_1" = "-m" ] \
>>>>  	|| { case "${COMP_WORDS[$COMP_CWORD]}" in
>>>>  		 --load-path=*) true;;
>>>>  		 *)             false;;
>>>
>>> I think this fails to account for the long form "--manifest".  Perhaps
>>> it's better to add a new "_guix_is_dash_m" and use
>>>
>>> "if _guix_is_dash_L || _guix_is_dash_m"
>>>
>>> below.  WDYT?
>>
>> Nice catch!  Thanks.
>>
>> But I don't know how to implement a file completion for ‘--manifest=’.
>> ‘--load-path=’ doesn't have a file completion too.  Only completion for
>> equal sign before.
>
> Oh, OK.  That's another issue I guess.  The patch below LGTM, but the
> commit message needs adjusting ;-)

Ouch, thank you for reminding.

Pushed as f5f916792c7069a22d95c5b7c68bcf3bbb86e451

I'll close the bug report.

Thanks,
Oleg.
[signature.asc (application/pgp-signature, inline)]

Reply sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
You have taken responsibility. (Sat, 17 Feb 2018 19:26:02 GMT) Full text and rfc822 format available.

Notification sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
bug acknowledged by developer. (Sat, 17 Feb 2018 19:26:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 18 Mar 2018 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 98 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.