()
| 148 | } |
| 149 | |
| 150 | func (f *Fish) GetPreamble() (lines []string) { |
| 151 | lines = []string{ |
| 152 | fmt.Sprintf("set -g __COD_BINARY %v", quoteArg(f.codCommandPath)), |
| 153 | ` |
| 154 | function __cod_complete_fish |
| 155 | set -l words (commandline --current-process --tokenize --cut-at-cursor) |
| 156 | set -l cword (count $words) |
| 157 | set -l words $words (commandline --current-token --cut-at-cursor) |
| 158 | set -l compreply (command $__COD_BINARY api complete-words -- %self "$cword" $words) |
| 159 | for entry in $compreply |
| 160 | echo $entry |
| 161 | end |
| 162 | return 0 |
| 163 | end |
| 164 | |
| 165 | function __fish_cod_get_completions |
| 166 | end |
| 167 | |
| 168 | function __cod_postexec_fish --on-event fish_postexec |
| 169 | set -l cmd "$argv[1]" |
| 170 | if test -n "$cmd" -a "$status" -eq 0 |
| 171 | command $__COD_BINARY api postexec -- %self "$cmd" |
| 172 | end |
| 173 | command $__COD_BINARY api poll-updates -- %self | source |
| 174 | end |
| 175 | |
| 176 | cod api attach -- %self fish |
| 177 | `, |
| 178 | } |
| 179 | return |
| 180 | } |
| 181 | |
| 182 | // |
| 183 | // Bash |
nothing calls this directly
no test coverage detected