Skip to content

Commit 652154d

Browse files
fix(complete): do not interpret flags on complete command (#674)
1 parent ff5d094 commit 652154d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/namespaces/autocomplete/autocomplete.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var autocompleteScripts = map[string]autocompleteScript{
5353
_scw() {
5454
_get_comp_words_by_ref -n = cword words
5555
56-
output=$(scw autocomplete complete bash "$COMP_LINE" "$cword" "${words[@]}")
56+
output=$(scw autocomplete complete bash -- "$COMP_LINE" "$cword" "${words[@]}")
5757
COMPREPLY=($output)
5858
# apply compopt option and ignore failure for older bash versions
5959
[[ $COMPREPLY == *= ]] && compopt -o nospace 2> /dev/null || true
@@ -82,7 +82,7 @@ var autocompleteScripts = map[string]autocompleteScript{
8282
CompleteFunc: `
8383
complete --erase --command scw;
8484
complete --command scw --no-files;
85-
complete --command scw --arguments '(scw autocomplete complete fish (commandline) (commandline --cursor) (commandline --current-token) (commandline --tokenize --cut-at-cursor))';
85+
complete --command scw --arguments '(scw autocomplete complete fish -- (commandline) (commandline --cursor) (commandline --current-token) (commandline --tokenize --cut-at-cursor))';
8686
`,
8787
CompleteScript: `eval (scw autocomplete script shell=fish)`,
8888
ShellConfigurationFile: map[string]string{
@@ -110,7 +110,7 @@ var autocompleteScripts = map[string]autocompleteScript{
110110
# we replace 'EMPTY_WORD' by '' later in go code
111111
words+=('EMPTY_WORD')
112112
fi
113-
output=($(scw autocomplete complete zsh $CURSOR $words))
113+
output=($(scw autocomplete complete zsh -- $CURSOR $words))
114114
opts=('-S' ' ')
115115
if [[ $output == *= ]]; then
116116
opts=('-S' '')

0 commit comments

Comments
 (0)