From: Oleg Pykhalov <go.wigust@gmail.com>
To: Marius Bakke <mbakke@fastmail.com>
Cc: 30495@debbugs.gnu.org, 30495-done@debbugs.gnu.org
Subject: bug#30495: [PATCH] bash completion: Complete files names after 'guix package -m'.
Date: Sat, 17 Feb 2018 22:25:11 +0300 [thread overview]
Message-ID: <87o9knto4o.fsf@gmail.com> (raw)
In-Reply-To: <87tvuftwxz.fsf@fastmail.com> (Marius Bakke's message of "Sat, 17 Feb 2018 17:14:48 +0100")
[-- Attachment #1: Type: text/plain, Size: 1681 bytes --]
Marius Bakke <mbakke@fastmail.com> writes:
> Oleg Pykhalov <go.wigust@gmail.com> writes:
>
>> Marius Bakke <mbakke@fastmail.com> writes:
>>
>>> Oleg Pykhalov <go.wigust@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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
prev parent reply other threads:[~2018-02-17 19:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-17 9:07 [bug#30495] [PATCH] bash completion: Complete files names after 'guix package -m' Oleg Pykhalov
2018-02-17 15:45 ` Marius Bakke
2018-02-17 16:03 ` Oleg Pykhalov
2018-02-17 16:14 ` Marius Bakke
2018-02-17 19:25 ` Oleg Pykhalov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o9knto4o.fsf@gmail.com \
--to=go.wigust@gmail.com \
--cc=30495-done@debbugs.gnu.org \
--cc=30495@debbugs.gnu.org \
--cc=mbakke@fastmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).