diff options
| author | Eyal Posener <[email protected]> | 2019-02-08 12:17:02 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-02-08 12:17:02 +0200 |
| commit | 43c37e8a9f3330efd8d954d555a6c3c15aadf3db (patch) | |
| tree | b5e80e74b62ffb4dc4bd69ed1b7d49a427e0f2b1 | |
| parent | 3ef9b31a6a0613ae832e7ecf208374027c3b2343 (diff) | |
| parent | 1fa456f134bec6a1d878413892080b4f715680c7 (diff) | |
Merge pull request #78 from gechr/gc-fix-fish-completion
Fix fish shell completion
| -rw-r--r-- | cmd/install/fish.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/install/fish.go b/cmd/install/fish.go index 6467196..c4f2018 100644 --- a/cmd/install/fish.go +++ b/cmd/install/fish.go @@ -41,12 +41,12 @@ func (f fish) cmd(cmd, bin string) (string, error) { params := struct{ Cmd, Bin string }{cmd, bin} tmpl := template.Must(template.New("cmd").Parse(` function __complete_{{.Cmd}} - set -lx COMP_LINE (string join ' ' (commandline -o)) - test (commandline -ct) = "" + set -lx COMP_LINE (commandline -cp) + test -z (commandline -ct) and set COMP_LINE "$COMP_LINE " {{.Bin}} end -complete -c {{.Cmd}} -a "(__complete_{{.Cmd}})" +complete -f -c {{.Cmd}} -a "(__complete_{{.Cmd}})" `)) err := tmpl.Execute(&buf, params) if err != nil { |
