Skip to content

Commit

Permalink
Fix fish subcommand completion
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
maxnordlund authored Feb 9, 2017
1 parent f36d735 commit e09d617
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion completions/pyenv.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e09d617

Please sign in to comment.