From e09d61780c608b12c53368024a6b15a24cea2292 Mon Sep 17 00:00:00 2001 From: Max Nordlund Date: Thu, 9 Feb 2017 15:15:28 +0100 Subject: [PATCH] Fix fish subcommand completion This allows subcommand style plugins to properly autocomplete. Existing commands are not affected. Example, say you have support for `pyenv foo bar --flag`, then this allows the last `--flag` argument to be properly completed. --- completions/pyenv.fish | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/completions/pyenv.fish b/completions/pyenv.fish index bf18b2a2..4d2d51d6 100644 --- a/completions/pyenv.fish +++ b/completions/pyenv.fish @@ -18,5 +18,6 @@ end complete -f -c pyenv -n '__fish_pyenv_needs_command' -a '(pyenv commands)' for cmd in (pyenv commands) - complete -f -c pyenv -n "__fish_pyenv_using_command $cmd" -a "(pyenv completions $cmd)" + complete -f -c pyenv -n "__fish_pyenv_using_command $cmd" -a \ + "(pyenv completions (commandline -opc)[2..-1])" end