summary refs log tree commit diff
path: root/etc/completion
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2021-10-03 14:02:04 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2021-10-03 19:23:48 +0200
commit17f76b209ceca9972dcd375d2a0f869abc6d1f26 (patch)
tree7073d6809f914f4e835e2cb0a147468cc42b61bf /etc/completion
parent6fba67df1928a62abc7939bd8ff020e998ad8d6b (diff)
downloadguix-17f76b209ceca9972dcd375d2a0f869abc6d1f26.tar.gz
bash completion: Append to $COMPREPLY where possible.
_guix_complete is always called with a fresh empty array.

* etc/completion/bash/guix (_guix_complete_command)
(_guix_complete_subcommand, _guix_complete_installed_package)
(_guix_complete_option, _guix_complete_pid): Append to $COMPREPLY rather
than re-assigning.
Diffstat (limited to 'etc/completion')
-rw-r--r--etc/completion/bash/guix12
1 files changed, 6 insertions, 6 deletions
diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
index 112ea789de..ea8f76f3e0 100644
--- a/etc/completion/bash/guix
+++ b/etc/completion/bash/guix
@@ -32,7 +32,7 @@ _guix_complete_command ()
                                      | grep '^    ' \
 				     | sed '-es/^ *\([a-z-]\+\).*$/\1/g')"
     fi
-    COMPREPLY=($(compgen -W "$_guix_commands" -- "$word_at_point"))
+    COMPREPLY+=($(compgen -W "$_guix_commands" -- "$word_at_point"))
 }
 
 _guix_complete_subcommand ()
@@ -41,7 +41,7 @@ _guix_complete_subcommand ()
     local subcommands="$(${COMP_WORDS[0]} $command --help 2> /dev/null \
                          | grep '^   [a-z]' \
                          | sed -e's/^ \+\([a-z-]\+\).*$/\1/g')"
-    COMPREPLY=($(compgen -W "$subcommands" -- "${COMP_WORDS[$COMP_CWORD]}"))
+    COMPREPLY+=($(compgen -W "$subcommands" -- "${COMP_WORDS[$COMP_CWORD]}"))
 }
 
 _guix_complete_available_package ()
@@ -54,7 +54,7 @@ _guix_complete_available_package ()
 	_guix_available_packages="$(${COMP_WORDS[0]} package -A 2> /dev/null \
                                     | cut -f1)"
     fi
-    COMPREPLY=($(compgen -W "$_guix_available_packages" -- "$prefix"))
+    COMPREPLY+=($(compgen -W "$_guix_available_packages" -- "$prefix"))
 }
 
 _guix_complete_installed_package ()
@@ -64,7 +64,7 @@ _guix_complete_installed_package ()
     local prefix="$1"
     local packages="$(${COMP_WORDS[0]} package -I "^$prefix" 2> /dev/null \
                       | cut -f1)"
-    COMPREPLY=($(compgen -W "$packages" -- "$prefix"))
+    COMPREPLY+=($(compgen -W "$packages" -- "$prefix"))
 }
 
 _guix_complete_option ()
@@ -79,7 +79,7 @@ _guix_complete_option ()
                             | grep '^  \+-' \
                             | sed -e's/^.*--\([a-zA-Z0-9_-]\+\)\(=\?\).*/--\1\2/g')"
     compopt -o nospace
-    COMPREPLY=($(compgen -W "$options" -- "$2"))
+    COMPREPLY+=($(compgen -W "$options" -- "$2"))
 }
 
 _guix_is_option ()
@@ -174,7 +174,7 @@ _guix_complete_file ()
 _guix_complete_pid ()
 {
     local pids="$(cd /proc; echo [0-9]*)"
-    COMPREPLY=($(compgen -W "$pids" -- "$1"))
+    COMPREPLY+=($(compgen -W "$pids" -- "$1"))
 }
 
 _guix_complete ()