aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-09-24 16:26:34 +0200
committerLudovic Courtès <ludo@gnu.org>2020-09-24 17:53:02 +0200
commit8e0c5033b17fcf1e4596ee9a3d52157900acc6fa (patch)
tree7f5a913d47e7c27304a3bcd4a9613a36be55cff1 /etc
parent215b49a8814093ef6b953b84efe30de1c3111665 (diff)
downloadguix-8e0c5033b17fcf1e4596ee9a3d52157900acc6fa.tar
guix-8e0c5033b17fcf1e4596ee9a3d52157900acc6fa.tar.gz
bash completion: Adjust to new 'guix help' output.
This is a followup to 3794ce93be8216d8378df7b808ce7f53b1e05a53, which broke command completion. Reported by Oleg Pykhalov <go.wigust@gmail.com>. * etc/completion/bash/guix (_guix_complete_command): Update to match output of 'guix help' as introduced in 3794ce93be8216d8378df7b808ce7f53b1e05a53.
Diffstat (limited to 'etc')
-rw-r--r--etc/completion/bash/guix5
1 files changed, 3 insertions, 2 deletions
diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
index aa217bd318..fdbdf46810 100644
--- a/etc/completion/bash/guix
+++ b/etc/completion/bash/guix
@@ -27,8 +27,9 @@ _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 \
+ | grep '^ ' \
+ | sed '-es/^ *\([a-z-]\+\).*$/\1/g')"
fi
COMPREPLY=($(compgen -W "$_guix_commands" -- "$word_at_point"))
}