Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Jan 16, 2024
1 parent 700490f commit e82f392
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions pkg/actions/bridge/bash.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ func ActionBash(command ...string) carapace.Action {
return carapace.ActionMessage(err.Error())
}

return carapace.ActionExecCommand("bash", "--rcfile", configPath, "-i", "-c", bashSnippet, shlex.Join(args))(func(output []byte) carapace.Action {
c.Setenv("COMP_LINE", shlex.Join(args))
return carapace.ActionExecCommand("bash", "--rcfile", configPath, "-i", "-c", bashSnippet)(func(output []byte) carapace.Action {
lines := strings.Split(string(output), "\n")
return carapace.ActionValues(lines[:len(lines)-1]...).StyleF(style.ForPath)
}).NoSpace([]rune("/=@:.,")...) // TODO check compopt for nospace
}).Invoke(c).ToA().NoSpace([]rune("/=@:.,")...) // TODO check compopt for nospace
})
}
6 changes: 2 additions & 4 deletions pkg/actions/bridge/bash.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/bin/bash
# set -e
# set -x
# set -o pipefail
source <(minikube completion bash)

[ -f /usr/local/etc/bash_completion ] && source /usr/local/etc/bash_completion # osx
[ -f /usr/share/bash-completion/bash_completion ] && source /usr/share/bash-completion/bash_completion # linux
[ -f /data/data/com.termux/files/usr/share/bash-completion/bash_completion ] && source /data/data/com.termux/files/usr/share/bash-completion/bash_completion # termux

COMP_LINE="$1"
# COMP_LINE="$1"
COMP_WORDS=($COMP_LINE)
if [ "${COMP_LINE: -1}" = " " ]; then
COMP_WORDS+=("")
Expand Down

0 comments on commit e82f392

Please sign in to comment.