summaryrefslogtreecommitdiff
path: root/community/schroot/colon-completion.patch
blob: 2df1bd16e6e05232afabc8cba181c3851048d52e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff -wbBur schroot-1.6.5.org/etc/bash_completion/schroot schroot-1.6.5/etc/bash_completion/schroot
--- schroot-1.6.5.org/etc/bash_completion/schroot	2013-01-28 15:28:04.000000000 +0400
+++ schroot-1.6.5/etc/bash_completion/schroot	2013-01-28 15:30:22.297213632 +0400
@@ -21,14 +21,14 @@
     local cur prev options
 
     COMPREPLY=()
-    cur=${COMP_WORDS[COMP_CWORD]}
-    prev=${COMP_WORDS[COMP_CWORD-1]}
+    _get_comp_words_by_ref -n : cur prev
 
     # Select precisely the tokens from schroot --help that begin with a dash
     options=$(schroot --help | sed 's/\(^\|[[:space:]]\)[^[:space:]-][^[:space:]]*//g')
 
     if [ "$prev" = "-c" ] || [ "$prev" = "--chroot" ]; then
         COMPREPLY=( $(compgen -W "$(schroot -a -l)" -- $cur) )
+        __ltrim_colon_completions "$cur"
     else
         COMPREPLY=( $(compgen -W "$options" -- $cur) )
     fi