From 9f52b56aa8bc75c31862ef998a98cee9ce7a3bfb Mon Sep 17 00:00:00 2001 From: Max Nordlund Date: Fri, 10 Feb 2017 09:12:30 +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 `rbenv foo bar --flag`, then this allows the last `--flag` argument to be properly completed. --- completions/rbenv.fish | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/completions/rbenv.fish b/completions/rbenv.fish index 3ca8e94..762f4c0 100644 --- a/completions/rbenv.fish +++ b/completions/rbenv.fish @@ -18,5 +18,6 @@ end complete -f -c rbenv -n '__fish_rbenv_needs_command' -a '(rbenv commands)' for cmd in (rbenv commands) - complete -f -c rbenv -n "__fish_rbenv_using_command $cmd" -a "(rbenv completions $cmd)" + complete -f -c pyenv -n "__fish_pyenv_using_command $cmd" -a \ + "(rbenv completions (commandline -opc)[2..-1])" end