aboutsummaryrefslogtreecommitdiff
path: root/etc/completion/bash
diff options
context:
space:
mode:
Diffstat (limited to 'etc/completion/bash')
-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"))
}