fish-shell/share/completions/ruby-build.fish
Fabian Homborg 5e555fc1cf Completions: Don't check $cmd[1]
This is already done by fish before calling the completion.

It breaks completion with combiners (#2025) and also with wrappers.

(This does not include git because that's better solved in #2145)
2015-08-17 12:29:03 +02:00

19 lines
800 B
Fish

function __fish_ruby-build_needs_command
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 ]
return 0
end
return 1
end
function __fish_ruby-build_definitions
ruby-build --definitions
end
complete -f -c ruby-build -n '__fish_ruby-build_needs_command' -a '(__fish_ruby-build_definitions)' -d 'Definition'
complete -f -c ruby-build -n '__fish_ruby-build_needs_command' -l keep -s k -d 'Do not remove source tree after installation'
complete -f -c ruby-build -n '__fish_ruby-build_needs_command' -l verbose -s v -d 'Verbose mode: print compilation status to stdout'
complete -f -c ruby-build -n '__fish_ruby-build_needs_command' -l definitions -d 'List all built-in definitions'
complete -f -c ruby-build -n '__fish_ruby-build_needs_command' -l help -s h -d 'Display help information'