* [bug#43509] [PATCH] bash completion: Fix completion for commands and subcommands.
@ 2020-09-19 12:52 Oleg Pykhalov
2020-09-21 21:41 ` Ludovic Courtès
0 siblings, 1 reply; 3+ messages in thread
From: Oleg Pykhalov @ 2020-09-19 12:52 UTC (permalink / raw)
To: 43509; +Cc: Oleg Pykhalov
* etc/completion/bash/guix
(_guix_complete_command, _guix_complete_subcommand): Fix completion.
---
etc/completion/bash/guix | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
index 98d20484f7..3bc9a48947 100644
--- a/etc/completion/bash/guix
+++ b/etc/completion/bash/guix
@@ -27,8 +27,7 @@ _guix_complete_command ()
if [ -z "$_guix_commands" ]
then
# Cache the list of commands to speed things up.
- _guix_commands="$(guix --help 2> /dev/null \
- | grep '^ ' | cut -c 2-)"
+ _guix_commands="$(guix --help 2> /dev/null | awk '/^ [a-z]/ { print $1 }')"
fi
COMPREPLY=($(compgen -W "$_guix_commands" -- "$word_at_point"))
}
@@ -36,9 +35,7 @@ _guix_complete_command ()
_guix_complete_subcommand ()
{
local command="${COMP_WORDS[1]}"
- local subcommands="$(${COMP_WORDS[0]} $command --help 2> /dev/null \
- | grep '^ [a-z]' \
- | sed -e's/^ \+\([a-z-]\+\).*$/\1/g')"
+ local subcommands="$(${COMP_WORDS[0]} $command --help 2> /dev/null | awk '/^ [a-z]/ { print $1 }')"
COMPREPLY=($(compgen -W "$subcommands" -- "${COMP_WORDS[$COMP_CWORD]}"))
}
--
2.28.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [bug#43509] [PATCH] bash completion: Fix completion for commands and subcommands.
2020-09-19 12:52 [bug#43509] [PATCH] bash completion: Fix completion for commands and subcommands Oleg Pykhalov
@ 2020-09-21 21:41 ` Ludovic Courtès
2020-09-24 15:57 ` bug#43509: " Ludovic Courtès
0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2020-09-21 21:41 UTC (permalink / raw)
To: Oleg Pykhalov; +Cc: 43509
Hi!
Oleg Pykhalov <go.wigust@gmail.com> skribis:
> * etc/completion/bash/guix
> (_guix_complete_command, _guix_complete_subcommand): Fix completion.
Oops, I see. Could you mention in the commit log that this is a
followup to 3794ce93be8216d8378df7b808ce7f53b1e05a53, which broke it all
(right?).
> # Cache the list of commands to speed things up.
> - _guix_commands="$(guix --help 2> /dev/null \
> - | grep '^ ' | cut -c 2-)"
> + _guix_commands="$(guix --help 2> /dev/null | awk '/^ [a-z]/ { print $1 }')"
Could we avoid awk?
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#43509: [PATCH] bash completion: Fix completion for commands and subcommands.
2020-09-21 21:41 ` Ludovic Courtès
@ 2020-09-24 15:57 ` Ludovic Courtès
0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2020-09-24 15:57 UTC (permalink / raw)
To: Oleg Pykhalov; +Cc: 43509-done
Hi,
Ludovic Courtès <ludo@gnu.org> skribis:
> Oleg Pykhalov <go.wigust@gmail.com> skribis:
>
>> * etc/completion/bash/guix
>> (_guix_complete_command, _guix_complete_subcommand): Fix completion.
>
> Oops, I see. Could you mention in the commit log that this is a
> followup to 3794ce93be8216d8378df7b808ce7f53b1e05a53, which broke it all
> (right?).
>
>> # Cache the list of commands to speed things up.
>> - _guix_commands="$(guix --help 2> /dev/null \
>> - | grep '^ ' | cut -c 2-)"
>> + _guix_commands="$(guix --help 2> /dev/null | awk '/^ [a-z]/ { print $1 }')"
>
> Could we avoid awk?
I went ahead and did that in 8e0c5033b17fcf1e4596ee9a3d52157900acc6fa.
Completion’s back! :-)
Ludo’.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-24 16:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-19 12:52 [bug#43509] [PATCH] bash completion: Fix completion for commands and subcommands Oleg Pykhalov
2020-09-21 21:41 ` Ludovic Courtès
2020-09-24 15:57 ` bug#43509: " Ludovic Courtès
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).