guix system build autocompletes with package list

  • Done
  • quality assurance status badge
Details
3 participants
  • Jesse Gibbons
  • Ludovic Courtès
  • Solene Rapenne
Owner
unassigned
Submitted by
Jesse Gibbons
Severity
normal
J
J
Jesse Gibbons wrote on 31 Jul 2019 04:44
(address . bug-guix@gnu.org)
20190730204433.332b57c9@gmail.com
In bash, when I type "guix system build" and press tab to autocomplete,
I get a list of packages. I would expect it to list scheme source files
like the "guix system {container,disk-image,docker-image,extension-graph,init,reconfigure,shepherd-graph,vm,vm-image}" autocompletes.
L
L
Ludovic Courtès wrote on 23 Aug 2019 14:30
control message for bug #36868
(address . control@debbugs.gnu.org)
87pnkw6p4g.fsf@gnu.org
tags 36868 + easy
quit
S
S
Solene Rapenne wrote on 15 Jun 2021 22:58
[PATCH] etc: completion: remove package list when using completion on guix system build
(address . 36868@debbugs.gnu.org)
20210615225815.2fd9ad77@perso.pw
---
etc/completion/bash/guix | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (17 lines)
diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
index 26480e5863..ef98e9feca 100644
--- a/etc/completion/bash/guix
+++ b/etc/completion/bash/guix
@@ -235,7 +235,7 @@ _guix_complete ()
fi
elif _guix_is_command "build"
then
- if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_f
+ if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_f || _guix_is_command "system"
then
_guix_complete_file
else
--
2.32.0

I am absolutely unsure about the commit message for such changes.
L
L
Ludovic Courtès wrote on 18 Jun 2021 11:59
(name . Solene Rapenne via Bug reports for GNU Guix)(address . bug-guix@gnu.org)
875yybh4rq.fsf@gnu.org
Hi,

Solene Rapenne via Bug reports for GNU Guix <bug-guix@gnu.org> skribis:

Toggle quote (15 lines)
> ---
> etc/completion/bash/guix | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
> index 26480e5863..ef98e9feca 100644
> --- a/etc/completion/bash/guix
> +++ b/etc/completion/bash/guix
> @@ -235,7 +235,7 @@ _guix_complete ()
> fi
> elif _guix_is_command "build"
> then
> - if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_f
> + if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_f || _guix_is_command "system"

It seems to me that if _guix_is_command "build" is true, then
_guix_is_command "system" cannot also be true. WDYT?

Thanks for addressing this longstanding issue!

Ludo’.
S
S
Solene Rapenne wrote on 18 Jun 2021 12:33
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 36868@debbugs.gnu.org)
20210618123353.1782c21f@perso.pw
Le Fri, 18 Jun 2021 11:59:53 +0200,
Ludovic Courtès <ludo@gnu.org> a écrit :

Toggle quote (26 lines)
> Hi,
>
> Solene Rapenne via Bug reports for GNU Guix <bug-guix@gnu.org> skribis:
>
> > ---
> > etc/completion/bash/guix | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
> > index 26480e5863..ef98e9feca 100644
> > --- a/etc/completion/bash/guix
> > +++ b/etc/completion/bash/guix
> > @@ -235,7 +235,7 @@ _guix_complete ()
> > fi
> > elif _guix_is_command "build"
> > then
> > - if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_f
> > + if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_f || _guix_is_command "system"
>
> It seems to me that if _guix_is_command "build" is true, then
> _guix_is_command "system" cannot also be true. WDYT?
>
> Thanks for addressing this longstanding issue!
>
> Ludo’.

the file has been reworked in commits

- dc3ba8c83602d69294e21d1b0c066f0d89890b56
- 80a17aae7991c6df061a98bb71734485f4ca17e2

now the code is entirely different and works as expected.

IIRC when I worked on this piece of code, _guix_is_command "foobar" was
looking for foobar in all words of the command. So you could have
_guix_is_command returning true for "build" and "system" at the same
time when using "guix system build".
L
L
Ludovic Courtès wrote on 20 Jun 2021 23:10
(name . Solene Rapenne)(address . solene@perso.pw)(address . 36868-done@debbugs.gnu.org)
87k0mo8cow.fsf@gnu.org
Hi,

Solene Rapenne <solene@perso.pw> skribis:

Toggle quote (7 lines)
> the file has been reworked in commits
>
> - dc3ba8c83602d69294e21d1b0c066f0d89890b56
> - 80a17aae7991c6df061a98bb71734485f4ca17e2
>
> now the code is entirely different and works as expected.

Heh, looks like Tobias & you felt the need to address this annoyance at
the same time. :-)

Toggle quote (5 lines)
> IIRC when I worked on this piece of code, _guix_is_command "foobar" was
> looking for foobar in all words of the command. So you could have
> _guix_is_command returning true for "build" and "system" at the same
> time when using "guix system build".

Ah OK.

Anyway, glad that it’s fixed now; thank you!

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 36868@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 36868
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch