From 9f52b56aa8bc75c31862ef998a98cee9ce7a3bfb Mon Sep 17 00:00:00 2001 From: Max Nordlund Date: Fri, 10 Feb 2017 09:12:30 +0100 Subject: [PATCH 1/2] 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 3ca8e945..762f4c07 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 From fab5cf912f5fe685f8b35b88f9c554b5e2f17e62 Mon Sep 17 00:00:00 2001 From: Max Nordlund Date: Fri, 10 Feb 2017 09:31:13 +0100 Subject: [PATCH 2/2] Fix pyenv -> rbenv typo --- completions/rbenv.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/rbenv.fish b/completions/rbenv.fish index 762f4c07..d3474105 100644 --- a/completions/rbenv.fish +++ b/completions/rbenv.fish @@ -18,6 +18,6 @@ end complete -f -c rbenv -n '__fish_rbenv_needs_command' -a '(rbenv commands)' for cmd in (rbenv commands) - complete -f -c pyenv -n "__fish_pyenv_using_command $cmd" -a \ + complete -f -c rbenv -n "__fish_rbenv_using_command $cmd" -a \ "(rbenv completions (commandline -opc)[2..-1])" end