File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ _clush()
32
32
local cur prev words cword split
33
33
local i word options="" compopts="" skip=argv0 groupsource="" cleangroup=""
34
34
local mode=command target_set=""
35
+ local shortopt=""
35
36
36
37
_init_completion -s -n : || return
37
38
@@ -76,6 +77,15 @@ _clush()
76
77
esac
77
78
done
78
79
80
+ # split short opts without space...
81
+ case "$cur" in
82
+ -[a-z]*)
83
+ shortopt="${cur:0:2}"
84
+ prev="$shortopt"
85
+ cur="${cur:2}"
86
+ ;;
87
+ esac
88
+
79
89
case "$prev" in
80
90
-w|-x|-g|--group|-X)
81
91
case "$cur" in
@@ -134,7 +144,9 @@ _clush()
134
144
fi
135
145
136
146
# append space for everything that doesn't end in `:` (likely a groupsource)
137
- mapfile -t COMPREPLY < <(compgen -W "$options" -- "$cur" | sed -e 's/[^:]$/& /')
147
+ mapfile -t COMPREPLY \
148
+ < <(compgen -W "$options" -- "$cur" \
149
+ | sed -e 's/[^:]$/& /' -e "s/^/$shortopt/")
138
150
# remove the prefix from COMPREPLY if $cur contains colons and
139
151
# COMP_WORDBREAKS splits on colons...
140
152
__ltrim_colon_completions "$cur"
You can’t perform that action at this time.
0 commit comments